iT邦幫忙

DAY 5
4

Ubuntu的學習之旅系列 第 5

Ubuntu Linux學習之旅(五)架設Samba Server

雖然上回說最好用FTP Server來取代網路芳鄰的SMB Server
但是企業或使用者有時候一定要使用SMB Server怎麼辦呢?
還好!Ubuntu Linux Server一樣有提供
那就是Samba Server
首先我們要安裝Samba套件
請執行下列指令:
sudo apt-get install samba samba-doc smbldap-tools

接下來一樣要輸入管理者密碼,並回答Y進行套件安裝
安裝完成之後就要設定Samba Server的設定檔
/etc/samba/smb.conf
底下是我家裡主機的sam.conf內容,提供參考
[global]
workgroup = Home
server string = %h server (Samba, Ubuntu)
wins support = no
wins server = 191.168.1.1
dns proxy = no
display charset=utf-8
doscharset=cp950
unix charset=utf-8
log file = /var/log/samba/%m.log
max log size = 1000
security = user
encrypt passwords = true
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = yes
map to guest = bad user
usershare allow guests = no

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no

[share]
path=/home/jack/share
browseable = yes
read only = no
;writable = yes
guest ok = yes
create mask = 0755
directory mask = 0755
修改smb.conf完成之後請存檔
然後重新啟動Samba Server
sudo /etc/init.d/samba restart
接下來要設定Samba User的密碼
請執行下列指令(jack就是我的使用者)
sudo smbpasswd -a jack
請依據它的提示,輸入兩次密碼
大功告成!接下來就可以利用工作站去存取Samba主機上的分享資源了!
再次提醒您將所有工作站的File and Printer sharing for Microsoft Network功能關閉,避免容易遭受攻擊!


上一篇
Ubuntu Linux學習之旅(四)架設FTP主機
下一篇
Ubuntu Linux學習之旅(六)安裝Filezilla FTP Client
系列文
Ubuntu的學習之旅43

尚未有邦友留言

立即登入留言