Build a samba server in ubuntu to share resources with widows

Source: Internet
Author: User

First, make sure that samba is installed in your ubuntu. If you install ubuntu server, you can choose to install the samba suite during installation.

If samba is not installed during ubuntu installation, you can install it later,

sudo apt-get install samba

Then modify the samba configuration file, pay attention to it, develop good habits, and back up the file before modification.

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
sudo vi /etc/samba/smb.conf

Search for this line of text code:

; security = user

Replace the following rows

Code:

security = user
username map = /etc/samba/smbusers

Change [global] and change workgroup = MSHOME to the following code: (Note that the WORKGROUP here is the name of the Working Group in the sharing process:

workgroup = WORKGROUP
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936

The following three lines are used to prevent Chinese directory garbled characters. Now you need to add the rails network access account. If this account does not exist in the system

Code:

sudo useradd rails

Note that the above only adds the rails user, but does not grant the user a local logon password. Therefore, this user can only be remotely accessed and cannot log on from the local machine. The samba logon password is also valid.

Different from the logon password on the local machine. Now, you need to add an account for a network user and set your rails password. This password is not used for Logon at startup, but you want to access the WIN shared file or

WIN Shared File Access Password

sudo smbpasswd -a rails

Create a new smbusers file in the samba directory.

sudo vi /etc/samba/smbusers 

Add the following line and save it.

rails = “network username”

Use this command to change the rails network access password in the future.

sudo smbpasswd -a rails

To delete a rails account in the future, run this command to delete it.

sudo smbpasswd -x rails

Then test OK.

sudo testparm 

Restart the samba server.

sudo restart smbd
sudo restart nmbd

 

At last, you only need to enter \ ip in your computer on windows to access the client. You need to enter the samba account and password you just set.

References:

Https://help.ubuntu.com/11.04/serverguide/C/samba-fileserver.html

Http://wiki.ubuntu.org.cn/Samba

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.