Installation configuration and use of samba in Ubuntu

Source: Internet
Author: User

The Samba service is not installed by default in the Ubuntu server version.

1. Installation of the Samba software package

Using the source installation, enter the following command in the terminal:

#sudo Apt-get Install Samba
#sudo Apt-get Install Smbclient


2. Startup, shutdown, and restart of the Samba server

To start the Samba server, simply execute the following command:
#sudo/etc/init.d/samba Start

To close the Samba server:
#sudo/etc/init.d/samba Stop

Restart the Samba server:
#sudo/etc/init.d/samba Restart



After starting the Samba server, you can use the PS command to view the process:
#ps-aux


You can see that the Samba service starts two services at the same time, where SMBD is primarily used to manage shared directories, and NMBD is primarily used to resolve NetBIOS names. In Windows systems, hosts can be added to a group so that each host must have a name that is used for the name on the web, not the hostname of the machine, which is called the NetBIOS name. Where the NMBD process starts as the SMBD process starts.

3. Configure Samba Services

The Samba server primary configuration file is/etc/samba/smb.conf, and the NetBIOS name can be written in the/etc/samba/lmhosts file with the host's corresponding relationship.

(1) Access the Linux shared directory without entering a password in the Windows system
Share a directory in Linux and write the setup information of the established directory to the/etc/smb.conf file. For example, if you are sharing the/home/myth/share directory, to access this shared directory in a Windows system, assume that the IP of the Windows host is the IP of the 192.168.0.11,linux host 192.168.10, do the following:
#mkdir/home/myth/share
sudo cp/etc/samba/smb.conf/etc/samba/smb.conf.bak//Better make a backup before modifying the configuration file
#vim/etc/samba/smb.conf
or open the configuration file with sudo gedit/etc/samba/smb.conf
Make the following changes to the contents of the file as follows:
#security =user after adding:
Security=share
Add the following line at the end of the file:
[Share]
Comment=this is Linux share directory
Path=/home/myth/share
Public=yes
Writable=yes

Save exit to start Samba service:
#/etc/init.d/samba start

Setup is complete!

Access the shared directory under Windows, click to run, enter
\\192.168.0.10\share

This allows you to access the shared directory share with anonymous users.

No write permission on Windows:chmod-r go+rwx share/

Installation configuration and use of samba in Ubuntu

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.