Install and configure Samba in Ubuntu 10.04

Source: Internet
Author: User

Sudo apt-get install samba
Sudo apt-get install smbfs
The following is a shared group that can read and write folders. Assume that the folder you want to share is/home/username/share.
First create this folder
Mkdir/home/messcode/share
Chmod 777/home/messcode/share
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
Find the Keyword:; security = user
Replace with these 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 messcode. The shared folder name is Share.
[Share]
Comment = Shared Folder with username and password
Path =/home/messcode/share
Public = yes
Writable = yes
Valid users = messcode
Create mask = 0700
Directory mask = 0700
Force user = nobody
Force group = nogroup
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.

Now you need to add the network access account messcode. If this account does not exist in the system, sudo useradd messcode
The above only adds the messcode user, but does not give the user a local logon password. Therefore, this user can only be remotely accessed and cannot log on from the local machine. In addition, the samba logon password can be different from the local logon password. Now you want to add a network user account:
Sudo smbpasswd-a newsfan
Sudo gedit/etc/samba/smbusers
Add the following line to the new file and save it.
Messcode = "network username"
Use this command to change the network access password of messcode in the future.
Sudo smbpasswd-a messcode
Run the command to delete the account of a network user and change-a to-x.
Sudo testparm
Sudo/etc/init. d/samba restart
Finally, log out and log on again or restart the machine.
 

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.