Ubuntu13.10 install the Samba server to share local files

Source: Internet
Author: User
1. In my opinion, Samba is used only to share files between Ubuntu virtual machines and Windows. Of course, this is only a small part of the services provided by Samba, and of course there are other methods to share, but this method is very nice to use. The official introduction to Samba is: Samba is a free software for implementing the SMB protocol on Linux and UNIX systems, which consists of servers and client programs. SMB (ServerMessagesBlock, information service block) is a type

1. Samba Introduction
In my opinion, Samba is only used to share files between Ubuntu virtual machines and Windows. Of course, this is only a small part of the services provided by Samba, and of course there are other methods to share, but this method is very nice to use.

The official introduction to Samba is: Samba is a free software for implementing the SMB protocol on Linux and UNIX systems, which consists of servers and client programs. Server Messages Block (SMB) is a communication protocol used to share files and printers on a LAN, it provides sharing services for files, printers, and other resources between different computers in the LAN.

2. Configure Samba on Ubuntu

Follow these steps:

Step 1: Install the samba Application
Sudo apt-get install samba
Sudo apt-get cifs-utils
I don't know if samba has been installed in ubuntu by default. But to find the startup Item in/etc/init. d, We need to reinstall it again.

Step 2: Create a shared directory:
Assume that the current user name is: share
Mkdir/home/username/share
Sudo chmod 777/home/username/share

Step 3: Create a samba account
Sudo useradd myname # the username you used when logging on to the client, or the username of the samba account you created

Sudo touch/etc/samba/smbpasswd
Sudo smbpasswd-amyname
// Samba account name

Prompt that the samba user is successfully added, and prompt that the password is entered
Sudo
Gedit/etc/samba/smbusers # Add a network user account:
Myname = "networkusername"

Step 4: Modify Samba configuration file: smb. conf
Sudo cp
/Etc/samba/smb. conf
/Etc/samba/smb. conf. bak
# Make a backup first
Sudo vim
/Etc/samba/smb. conf
1. Find the [global] field and add it to it:
Displays charset = UTF-8

Unix charset = UTF-8

Dos charset = cp936
This is to prevent Chinese directory garbled characters.

2. Add the share field at the end
[Share]
Path =/home/username/share
Available = yes

Browseable = yes
Public = yes
Writable = yes

Valid users = myname # myname is the username of your login server, which is set in step 3.

Create mask = 0700

Directory mask = 0700

Force user = nobody

Force group = nogroup

3. Run the command: sudo testparm to check whether the edited smb. conf has a syntax Error. If no Error occurs, it will be okay.

Step 5: Restart the samba server
Sudo/etc/init. d/samba restart
Now we have completed the configuration. in the windows taskbar, enter \ your host's IP address to see share. The password for myname is your own.

Samba details: Click here
Samba: Click here

Related reading:

Samba file sharing-implementing heterogeneous communication http://www.linuxidc.com/Linux/2013-03/81152.htm

VMWare Virtual Machine Ubuntu dual Nic samba access speed doubled http://www.linuxidc.com/Linux/2013-06/85445.htm

Samba File Sharing Server joining Windows Server 2003 domain http://www.linuxidc.com/Linux/2013-06/86391.htm

Samba installation configuration http://www.linuxidc.com/Linux/2013-06/86101.htm

Configuration http://www.linuxidc.com/Linux/2013-01/78390.htm for Samba services in CentOS 6.2

Graphic http://www.linuxidc.com/Linux/2013-01/78234.htm for building Win7 + VMware + Fedora18 Samba Server

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

Related Article

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.