Linux Resource Sharing samba configuration 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 // Working Group
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 /// modify the port address
80; hosts allow = 127. 192.168.12. 192.168.13. //// which network segment is allowed to access
89; log file =/var/log/samba/% m. log // the log file storage location will generate an ip. log file only when it is accessed.
101 security = user // permission 1. share permission Anonymous Access 2. user permission authentication samba account Library (local) 3. server permission authentication samba account Library (on other servers) 4.ads (domain) authentication samba account Library (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] // Share Name
264 comment = All Printers
265 path =/tmp/pub // directory location
266 browseable = yes // readable
267 guest OK = yes // anyone can access
268 writable = no // not writable
269 [sauser2]
270 comment = All user2
271 path =/tmp/user2
272 browseable = yes
273 guest OK = yes
274 valid users = user2 // only user user2 can access this directory.
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 // check whether the test result is correct
[Root @ mail ~] # Smbpasswd-a user2
New SMB password:
Retype new SMB password:
Added user user2.
[Root @ mail ~] # Smbpasswd-a user3 // The password can be different from the Local User Password
New SMB password:
Retype new SMB password:
Added user user3.
[Root @ mail ~] # Service smb restart
After the feature is enabled, user2 and user3 can only access directories that can be accessed by themselves, but cannot access other directories.
Author: "yuanmengxing"