SLES 12
Sponsored Link

Limited accessed shared Folder2015/11/23

 
Install Samba to build a File Server.
For example, Create a shared Folder which requires user authentication.
[1] Install and Configure Samba.
smb:~ #
zypper -n install samba samba-client
smb:~ #
groupadd security

smb:~ #
mkdir /home/security

smb:~ #
chgrp security /home/security

smb:~ #
chmod 770 /home/security

smb:~ #
vi /etc/samba/smb.conf
# line 5: add

unix charset = UTF-8
# line 13: comment out

#
map to guest = Bad User
# add follows to the end

[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
smb:~ #
systemctl start smb

smb:~ #
systemctl start nmb

smb:~ #
systemctl enable smb

smb:~ #
systemctl enable nmb
# add a user in Samba

smb:~ #
smbpasswd -a suse

New SMB password:    
# set password

Retype new SMB password:
Added user suse.
smb:~ #
usermod -G security suse

[2] It's the way to access to the shared folder. This example is on Windows 10.
Select [Computer] - [network] - [Map Network Drive].
[3] Specify the shared folder's place in Folder section and Click the 'Finish' button to enter.
[4] Authentication is required, Input the username and password you added in Samba.
[5] Just accessed.
Matched Content