2008年7月19日 星期六

架設Samba

環境:
Server IP:192.168.0.1
Networks:192.168.0.0/255.255.255.0


設定:

vi /etc/samba/smb.conf

全數清空,改為以下

#======================= Global Settings =======================
[global]
log file = /var/log/samba/log.%m #記錄檔存放點
display charset = utf8 #顯示之字碼為utf-8
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192 #Socket
obey pam restrictions = Yes
encrypt passwords = True
domain master = Yes #設為DMB
local master = Yes #設為LMB
preferred master = Yes #設為PDC
interfaces = eth0 #負責的網卡
hosts allow = 192.168.0.0/255.255.255.0 #允許的主機
passdb backend = tdbsam
passwd program = /usr/bin/passwd %u
template shell = /bin/false
wins support = true #將主機設為Wins
dns proxy = no
netbios name = teed7334.idv.tw #主機名稱
netbios aliases = teed7334.idv.tw #主機別名
server string = %h server
invalid users = root #禁止進入的使用者
dos charset = cp950
workgroup = WORKGROUP #使用的工作群組
os level = 255 #0~255,數值越大,越優先成為LMB、DMB
syslog = 0
security = user
unix charset = utf8
panic action = /usr/share/samba/panic-action %d
max log size = 1000

#======================= Share Definitions =======================

[homes] #使用者家目錄
comment = Home Directories #分享的資料夾別名
create mode = 700 #新增檔案預設權限
directory mode = 600 #新增資料夾預設權限
valid users = %S
writeable = yes #預設可寫入
public = yes #公開

[Temp] #資料暫存區
comment = Temp #分享的資料夾別名
create mode = 777 #新增檔案預設權限
directory mode = 777 #新增資料夾預設權限
writeable = yes #預設可寫入
public = yes #公開
path = /tmp #分享資料夾系統路徑

[Game] #分享資料夾
comment = Game Directories #分享的資料夾別名
create mode = 777 #新增檔案預設權限
directory mode = 777 #新增資料夾預設權限
path = /mnt/hdb/game #分享資料夾系統路徑
write list = a1,a2,a3 #分享資料夾系統路徑

/etc/init.d/samba restart

沒有留言: