linux资源共享samba配置server
samba.i386
samba-common.i386
[root@mail Server]# yum install samba-3.0.33-3.28.el5.i386.rpm
[root@mail ~]# vi /etc/samba/smb.conf
74 workgroup = MYGROUP /////工作组
75 server string = Samba Server Version %v
76
77 ; netbios name = MYSERVER
78
79 ; interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 ////修改端口地址
80 ; hosts allow = 127. 192.168.12. 192.168.13. /////允许哪个网段访问
89 ; log file = /var/log/samba/%m.log //////日志文件存放位置 只有被访问时会生成一个ip.log的日志文件
101 security = user /////权限 1.share 权限 匿名可以访问 2.user 权限 身份验证 samba账号库(在本地) 3.server 权限 身份验证 samba账号库(在其他服务器) 4.ads (domain) 身份验证 samba账号库(dc)
102 passdb backend = tdbsam
[root@mail ~]# mkdir /tmp/pub
[root@mail ~]# mkdir /tmp/user2
[root@mail ~]# mkdir /tmp/user3
[root@mail tmp]# chown user2:user2 user2
[root@mail tmp]# chown user3:user3 user3
263 [pub] ///////共享名
264 comment = All Printers
265 path = /tmp/pub //////目录位置
266 browseable = yes ///////可读
267 guest ok = yes ///////任何人可以访问
268 writable = no ///////不可写
269 [sauser2]
270 comment = All user2
271 path = /tmp/user2
272 browseable = yes
273 guest ok = yes
274 valid users = user2 //////只有用户user2可以访问此目录
275 writable = yes
276 [sauser3]
277 comment = All user3
278 path = /tmp/user3
279 browseable = yes
280 guest ok = yes
281 valid users = user3
282 writable = yes
[root@mail ~]# testparm //////查看测试结果是否有错
[root@mail ~]# smbpasswd -a user2
New SMB password:
Retype new SMB password:
Added user user2.
[root@mail ~]# smbpasswd -a user3 ////密码可以和本地用户密码不同
New SMB password:
Retype new SMB password:
Added user user3.
[root@mail ~]# service smb restart
开启之后user2和user3 只能访问自己可以访问的目录不能访问其他目录