Samba server Creation

Source: Internet
Author: User

[Configure Samba]
1. Install
Sudo apt-Get install samba
Sudo apt-Get install smbfs

2. Create a shared folder
Mkdir/home/LiY/share
Chmod 777/home/LiY/share

3. Back up and edit smb. conf to allow network users to access
Sudo CP/etc/samba/smb. conf/etc/samba/smb. conf_backup
Sudo gedit/etc/samba/smb. conf

Search for this line of text "; security = user"
Replace the following rows
Security = user
Username map =/etc/samba/smbusers

Add the following lines to the end of the file. Assume that the user allowed to access the file is newsfan. The shared folder name is share.
[Share]
Comment = shared folder with username and password
Path =/home/LiY/share
Public = Yes
Writable = Yes
Valid users = yourname

Create mask = 0777
Directory mask = 0777
Force user = A [A is the user name you are logged on to.]
Force Group = B [B is the user group corresponding to user A]
Available = Yes
Browseable = Yes

Change the value here by the way. Find [Global] and change workgroup = mshome
Workgroup = workgroup
Displays charset = UTF-8
UNIX charset = UTF-8
DOS charset = cp936
The following three lines are used to prevent Chinese directory garbled characters. Depending on your local, the UTF-8 may need to be changed to cp936. Do it yourself.

4. Now add the newsfan network access account. If this account does not exist in the system
Sudo useradd yourname

Sudo smbpasswd-A yourname

Sudo gedit/etc/samba/smbusers
Add the following line to the new file and save it.
Newsfan = "Network username"
 
Use this command to change the newsfan network access password in the future.
Sudo smbpasswd-A yourname

 

 

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.