歡迎您光臨本站 註冊首頁

Samba 伺服器

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

Samba 伺服器

Samba 伺服器

Samba 官方網站:http://samba.org/

yum -y install samba samba-client
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf
-----------------------------------------------------------------

netbios name = STUDENT
#samba 主機在網路上的芳鄰內出現的名字,預設為伺服器的 hostname,大小寫不拘,不過,netbios name 和 workgroup 不要設成一樣的名字

workgroup = SERVER
#相當於 Windows 下的工作群組

hosts allow = 192.168.1.0/255.255.255.0
hosts deny = ALL

security = user
encrypt passwords = yes

deadtime = 20

admin users = sysadm

############### 底下為要分享的資料夾(網路磁碟機)#############

comment = %U 的家目錄
browseable = no
writable = yes
force create mode = 0755


comment = 作業繳交
path = /home/homework
valid users = sysadm,@s94
#valid users 表示誰可以進入這個資料夾,加 @ 表群組, @s94 表 s94 這個群組,當然系統內需要預先建有 s94 這個群組
write list = sysadm,@s94
force create mode = 0755


comment = 資源分享(這裡放有上課用的教材、軟體)
path = /home/share
valid users = sysadm,@s94
write list = sysadm
force create mode = 0755
------------------------------------------------------------------
設定檔檢查:testparm

建立 homework、share 資料夾和修改權限:

    mkdir /home/homework /home/share
    chmod 777 /home/homework
    chmod 755 /home/share
    chown sysadm.sysadm /home/homework /home/share

新增 sysadm 帳號的 samba 密碼:

    smbpasswd -a sysadm

    more /etc/samba/smbpasswd

啟動 samba :

    /etc/rc.d/init.d/smb start
    chkconfig smb on

測試:

    在 Windows XP 下開啟檔案總管:\\IP

for Windows XP 網路磁碟機批次檔:

    在桌面編輯 登入學生主機.bat 批次檔

    net use w: \\IP\homes
    net use x: \\IP\share
    net use y: \\IP\homework
    net time \\IP /set /yes

    直接將帳號密碼寫進批次檔的寫法

    net use w: \\IP\homes /user:username password
    net use x: \\IP\share
    net use y: \\IP\homework
    net time \\IP /set /yes

在 Linux 文字模式下的掛載方式:

    mkdir /media/smb
    smbclient -L IP

    掛載:mount.cifs //IP/share /media/smb -o username=sysadm
    卸載:umount.cifs /media/smb

    密碼直接打在指令內的寫法:

    mount.cifs //IP/share /media/smb -o username=sysadm,password=password

光碟映像檔製作軟體(for Windows):

    * CDBurnerXP Pro:http://www.cdburnerxp.se/
    * ISO Recorder:http://isorecorder.alexfeinman.com/isorecorder.htm(只能用在 Windows XP)
    * IsoBuster:http://www.smart-projects.net/isobuster/
    * Nero:http://www.nero.com/en/index.html

光碟映像檔掛載軟體(for Windows):

    * Daemon tools 官方網站:http://www.daemon-tools.cc/
          o DAEMON Tools:http://www.daemon-tools.cc/dtcc/download.php?mode=ViewCategory&catid=5
          o FastMount:http://www.daemon-tools.cc/dtcc/download.php?mode=Download&id=33

smbstatus - report on current Samba connections
chmod 介紹
The Official Samba-3 HOWTO and Reference Guide:http://us4.samba.org/samba/docs/man/Samba-HOWTO-Collection/
Samba-3 by Example:http://us4.samba.org/samba/docs/man/Samba-Guide/


來源:http://apt.nc.hcc.edu.tw/web/student_server_centos/student_server_centos.html#samba

[火星人 ] Samba 伺服器已經有442次圍觀

http://coctec.com/docs/service/show-post-22973.html