Fedora 21
Sponsored Link

Limited Accessed Shared Folder2014/12/23

 
Install Samba to build a File Server.
This example shows to create a shared Folder which requires user authentication.
[1] Configure Samba.
[root@lan ~]#
yum -y install samba samba-client
[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
# near line 66: add follows

unix charset = UTF-8
dos charset = CP932
# line 90: change (Windows' default)

workgroup =
WORKGROUP
# line 96: uncomment and change IP address you allow

hosts allow = 127.
10.0.0.
# 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
[root@lan ~]#
systemctl start smb

[root@lan ~]#
systemctl start nmb

[root@lan ~]#
systemctl enable smb

[root@lan ~]#
systemctl enable nmb
# add a user in Samba

[root@lan ~]#
smbpasswd -a fedora

New SMB password:
# set password

Retype new SMB password:
# confirm

Added user fedora.
[root@lan ~]#
usermod -G security fedora

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