«

»

三月 12

CentOS-Samba伺服器設定

[root@localhost ~]#cd /etc/samba
[root@localhost ~]#cp smb.conf smb.conf.bak
[root@localhost ~]#vim smb.conf

workgroup = Workgroup
server string = Samba Server
netbios name = samserver
unix charset = utf8(Linux 伺服器使用的編碼)
display charset = utf8(顯示編碼)
dos charset = cp950(Windows 用戶的編碼)
hosts allow = 192.168.1.0/24
hosts deny = ALL
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
template shell = /bin/false
winbind use default domain = no
log file = /var/log/samba/%m.log
max log size = 50
security = user(有關密碼的設定)
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd

[homes]
comment = Home directories
browseable = no(不會開放給其他人瀏覽)
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775

[public]
comment = the user groups work directory
path = /home/public
public = yes
writable = yes

[date]
comment = date
path = /home/date
create mask = 0777
directory mask = 0777
valid users = test,@users(表示誰可以進入這個資料夾,加 @ 表群組)
write list = test,@user(表示誰可以修改這個資料夾,加 @ 表群組)

[root@localhost ~]#mkdir /home/date
[root@localhost ~]#chmod 777 /home/date
[root@localhost ~]#chown date:date /home/date
[root@localhost ~]#testparm(測試語法)
[root@localhost ~]#/etc/rc.d/init.d/smb start
[root@localhost ~]#chkconfig smb on
Related Posts Plugin for WordPress, Blogger...

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *

您可以使用這些 HTML 標籤和 attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>