红联Linux门户
Linux帮助

Samba服务器调试手记

发布时间:2006-08-30 00:23:19来源:红联作者:iLove.Rain
本文以Redhat Enterprice Linux AS4为测试平台,samba为系统自带。
Samba服务器调试手记
平台:redhat linux AS4
实现环境:
引用:
组:group1,group2,group3
用户:user101,user102,user103 属于group1,都没有home目录
   user201,user202,user203 属于group2,都没有home目录
   user301,user302,user303 属于group3,有home目录


[code]groupadd group1
groupadd group2
groupadd group3
useradd user101 -g group1 -M
useradd user102 -g group1 -M
useradd user103 -g group1 -M
useradd user201 -g group2 -M
useradd user202 -g group2 -M
useradd user203 -g group2 -M
useradd user303 -g group3
useradd user302 -g group3
useradd user301 -g group3
mkdir /home/folder1
mkdir /home/folder2
mkdir /home/folder3
smbpasswd -a user101
smbpasswd -a user102
smbpasswd -a user103
smbpasswd -a user203
smbpasswd -a user202
smbpasswd -a user201
smbpasswd -a user301
smbpasswd -a user302
smbpasswd -a user303
chmod -R 777 /home/folder1
chmod -R 777 /home/folder2
chmod -R 777 /home/folder3

[global]
workgroup = MYGROUP
server string = Samba Server
log file = /var/log/samba/%m.log
max log size = 50
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
dns proxy = no
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /bin/false
winbind use default domain = no
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775
[folder1]
comment = test folder1
path = /home/folder1
public = no
; browseable = no //设定该文件夹不可见,在权限允许情况下可以通过输入完整的地址来访问
valid users = @group1 @group2 //设定允许登陆的用户或组,用空格分隔
write list = @group1 //设定可写的用户或组
printable = no
[folder2]
comment = text folder2 //设定文件夹权限:chmod -R 1777 /home/folder2
path = /home/folder2 //使用户只能修改自己创建的文件和文件夹
public = yes
writable = yes
[public]
comment = Read Only Public
path = /home/public
public = yes
read only = yes //设定文件夹只读[/code]
文章评论

共有 0 条评论