Friday, May 18, 2018

samba server configration with user authentication main configration file



yum install samba*

main file 

Vim /etc/samba/smb.conf

All interface in samba server who can excess samba server

interfaces = lo eth0 192.168.12.2/24 192.168.13.2/24 192.168.122.2/24 10.0.227.2/24 192.168.100.1/24

hosts allow = 127. 192.168.12. 192.168.13. 192.168.122. 10.0.227. 192.168.100.





samba server main configration file.

[Common]
comment = All Users
path = /home/samba
writable = yes
browsable = yes
guest ok = yes
guest only = yes
create mode = 0777
directory mode = 0777

[HR]
comment = HR
    path = /home/samba/HR
 #       writeable = yes
        browsable = yes
        read only = No
    create mask = 0754
    directory mask = 0777
#    guest only = Yes
    guest ok = no
        valid users = @smbgroup hr
[Admin]
comment = Admin
        path = /home/samba/Admin
  #      [writeable = yes
        browsable = yes
        read only = No
        create mask = 0754
        directory mask = 0777
#       guest only = Yes
        guest ok = no
        valid users = @smbgroup hr admin
[User_Backup]
comment = UserBackup
        path = /home/samba/UserBackup
   #     writeable = yes
        browsable = yes
        read only = No
        create mask = 0754
        directory mask = 0777
#       guest only = Yes
        guest ok = no
        valid users = @smbgroup

[HEAD_GROUP]
comment = HEADGROUP
        path = /home/samba/HEAD_GROUP
    #    writeable = yes
        browsable = yes
        read only = No
        create mask = 0754
        directory mask = 0777
#       guest only = Yes
        guest ok = no
        valid users = @smbgroup

[IT_Department]
comment = IT Department
        path = /home/samba/IT_Department
    #    writeable = yes
        browsable = yes
        read only = No
        create mask = 0754
        directory mask = 0777
#       guest only = Yes
        guest ok = no
        valid users = @smbgroup


/etc/init.d/smbd restart
/etc/init.d/smbd start
/etc/init.d/smbd start
checkconfig smbd on
Check share all folder in samba server  


smbclient -L localhost -U%

drwxrwxrwx  6 root   root   4096 Feb  1 17:18 .
drwxr-xr-x. 9 root   root   4096 Feb  1 18:02 ..
drwxrwxr-x  2 root   admin  4096 Feb  1 17:18 Admin
drwxrwxrwx  3 nobody nobody 4096 Feb  1 16:36 bbb
drwxrwxrwx  2 nobody nobody 4096 Feb  1 17:08 dd
drwxrwxr-x  3 root   hr     4096 Feb  1 18:38 HR






Browse samba server in client side 


 smb://192.168.122.179   or smb://samba

No comments:

Post a Comment