LINUX Create a shared directory that requires user authentication.

[root@lan ~]#groupadd security
[root@lan ~]#mkdir /home/security
[root@lan ~]#chgrp security /home/security
[root@lan ~]#chmod 770 /home/security
[root@lan ~]#vi /etc/samba/smb.conf
# line 102: change

security =user
# add at the last line

[Security]      # any name you like
   path = /home/security
   writable = yes
   create mode = 0770
   directory mode = 0770
   share modes = yes
   guest ok = no     # guest not allowed
   valid users = @security        #allow only security group
[root@lan ~]#/etc/rc.d/init.d/smb restart
Shutting down SMB services:[  OK  ]
Starting SMB services:[  OK  ]
[root@lan ~]#smbpasswd -a cent    # add a user in Samba
New SMB password:       # set password
Retype new SMB password:   # confirm
Added user cent.
[root@lan ~]#vi /etc/group
security:x:502:cent

Comments

Popular posts from this blog

LINUX Move and copy files using SSH

PHP Predefined Variables

Java : Variables Declaring