Set up samba under Ubuntu16.04 64-bit to enable resource sharing between Linux and Windows

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.