Samba is an implementation of SMB that is used primarily to implement file and print services for Linux systems. Linux users can share resources with Windows users by configuring them to use the Samba server.
1. What we need to do first is to install samba under our Ubuntu:
Install samba: sudo apt-get install samba
installation smbclient: sudo apt-get install smbclient
2. Modify the configuration file
vi/etc/samba/smb.conf Edit smb.conf file
At the end of the configuration file, add
[Share]
Comment = Shared Folder require password
Path =/home/share
Public = yes
writable = yes
Valid users = Share
Create mask = 0777
Directory mask = 0777
force user = Nobody
Force Group = Nogroup
Available = yes
browseable = yes
Restart Samba after saving: Sudo/etc/init.d/samba Restart
3. Set User and password
sudo smbpasswd-a share then I prompt to enter the password. (Provided this user is added: Useradd share)
Otherwise the system does not have this user's premise to press the default action is to report the following error:
Added samba user hint Failed to add entry for user
[Email protected]:/home# smbpasswd-a share
New SMB Password:
Retype new SMB Password:
Failed to add entry for user share.
Workaround:
This is because there is no corresponding system account, so will prompt failed to add entry for user error, just add the corresponding system account share can be:
[Email protected]:/home# groupadd SHARE-G 6000
[Email protected]:/home# useradd share-u 6000-g 6000-s/sbin/nologin-d/dev/null
4, the last computer right-click Add a network location
Enter the folder box \\IP address \share, follow the prompts to enter the user name password.
Additional:
In order to increase the security of the system, the folder only want to give share users read and Write permission!
[Email protected] ~]# chown-r share/home/share/
If you don't want another person to access it, just let the share user have access, just execute the command:
[Email protected] ~]# chmod u+rwx,g+rwx,o-rwx/home/share
Set up samba under Ubuntu16.04 64-bit to enable resource sharing between Linux and Windows