Configuring Samba services under Ubuntu and Win7 under virtual machines for file sharing (LAN can also be shared)

Source: Internet
Author: User

1. If the Samba service is not installed, install

sudo apt-get install samba
sudo apt-get install Smbfs

2. After installation, modify the SMB configuration file, mainly configure the shared file path, the shared user

Vim/etc/samba/smb.conf
[Codes]						//Final share name you access, such as Win7 under:  \\ubuntu_ip\codes
   comment = This is a shared dir Path	
   =/home/jackzhous/mymnt	//shared paths, you need to set the path's permissions to 777 public
   = yes
   writable = yes
   Valid users = Jackzhous			//Login username  The user must actually exist with the Ubuntu system, and also set the password for the SMB service to
   Create mask = 0700
   Directory mask = 0700
   force user = Nobody
   force group = Nogroup
   available = yes
   browseable = yes

3. Set the shared path and permissions, set the user

#sudo smbpasswd-a User Name

Adding network permissions for this user name

sudo gedit/etc/samba/smbusers

Write in file: Username = "Network username"

4. Close the Ubuntu and Win7 firewalls

Ubuntu:sudo UFW Disable

Win7: Control Panel-> Network and intent wait, it's easy to find.

5. Start the SMB Service

#sudo Testparm

#sudo Service SMBD Restart 6. Access

On the Win7 File Manager, enter: \\ubuntu_ip\ the shared name set can be

The above operation is with the virtual machine window to achieve data sharing, whether this is also the local area network has not tried; on the basis of the above, a number of configuration to achieve computer sharing in the LAN:

Installing SMB Clients

sudo apt-get install smbclient

To install a graphical SMB server:

sudo apt-get install System-config-samba

To start the graphical interface:

sudo system-config-samba

If the error is in the startup process, the form


Then you'll be able to solve it by creating that file on your own path.

You can then start the graphical SMB and then configure the SMB user in the preferences as well as the user rules above;

After starting the SMB service SUDO/ETC/INIT.D/SMBD start

Shut down firewall sudo ufw disable

Under window: \\ip\ share name to access the


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.