Configure Samba sharing for Windows Access in Ubuntu

Source: Internet
Author: User
1. Install the javastusamba server $ sudoapt-getinstallsamba $ sudoapt-getinstallsmbclient # Linux client Test 2. Create the samba configuration file 1. back up the original configuration file $ sudocp/etc/samba/smb. conf/etc/samba/smb. conf. bak2.

1. Install the Ubuntu samba Server

$ Sudo apt-get install samba

$ Sudo apt-get install smbclient # Linux client for testing

 


2. Create a samba configuration file

1. Back up the original configuration file

$ Sudo cp/etc/samba/smb. conf/etc/samba/smb. conf. bak

 


2. Create a shared directory

$ Sudo mkdir-p/home/share

In general, the permission for this directory is 755. After you change it to 777, users other than Owner have the permission to write data.

$ Sudo chmod 777/home/share

 


3. modify the configuration file

$ Sudo vim/etc/samba/smb. conf

Add the following at the end of smb. conf:

[Share]

Path =/home/share

Browseable = yes

Writable = yes

Comment = smb share test

In addition, summarize the common samba configurations and instructions:

[Share] # Name of the share

Comment = smb share test # remarks about the share

Path =/home/share # share path

Allow hosts = host (subnet) # Set the workgroup or domain allowed by the Samba server

Deny hosts = host (subnet) # sets the workgroup or domain that the Samba server rejects.

Available = yes | no # Set whether the shared directory is available

Browseable = yes | no # Set whether the shared directory can be displayed

Writable = yes | no # specifies whether the directory can be written by default. You can also use readonly = no to set the writable directory.

Public = yes | no # indicates whether the shared resource can be accessed by the visitor's account. guest OK = yes is actually the same as public = yes.

User = user, @ group # user sets all users who may use the shared resource. You can also use @ group to represent all members of the group. Different projects are separated by spaces or commas.

Valid users = user, @ group # specify users and groups that can use the shared resource

Invalid users = user, @ group # specify users and groups that cannot use the shared resource

Read list = user, @ group # specify users and groups that can only read the shared resource

Write list = user, @ group # specify the users and groups that can read and write the shared resource.

Admin list = user, @ group # specify the users and groups that can manage the shared resources (including read/write and permission granting ).

Hide dot files = yes | no # indicates whether to hide files starting with "." As UNIX does

Create mode = 0755 # indicates the attributes of the newly created file, which is generally 0755

Directory mode = 0755 # indicates the attributes of the newly created directory, which is generally 0755

Sync always = yes | no # specifies whether to perform synchronization after writing the shared resource.

Short preserve case = yes | no # specifies whether the file name is case sensitive.

Preserve case = yes | no # specifies whether to keep the case sensitivity

Case sensitive = yes | no # specifies whether it is case sensitive. Generally, no is selected. Otherwise, an error may occur.

Mangle case = yes | no # specifies the mixed case

Default case = upper | lower # specifies whether all the default file names are in upper or lower case.

Force user = testuser # force the owner of the file to be created. If I have a directory that can be written by guest, the guest can be deleted. If I use force user = testuser to force the file to be created, the file owner is testuser, And the create mask = 0755, in this way, the guest cannot be deleted.

Wide links = yes | no # indicates whether to allow external symbolic connections. For example, a connection in a shared resource directs to a file or directory in a non-shared resource, if wide links = no is set, the connection will be unavailable.

Max connections = 100 # set the maximum number of simultaneous connections

Delete readonly = yes | no # indicates whether to delete a file that has been defined as read-only in a shared resource.

 


3. Create a samba user

Note: before creating a samba user, ensure that a Linux user with the same name exists. Otherwise, the creation of the samba user fails.

$ Sudo smbpasswd-a smbuser

 


4. Restart the samba Service

$ Sudo service smbd restart

 


V. Client Access Test

1. Linux client access test

$ Smbclient-L // localhost/share

 


2. Windows client access test

You can access the following address:

\ IP or host name \ share

If public = no, enter the samba user password. If public = yes, access the client directly as a nobody user.

In addition, you can use the net use */del/y command on the Windows client to clear the access cache.

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

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.