The method to deploy the samba server in ubuntu

  • 2020-05-12 06:36:21
  • OfStack

The Samba service is not installed by default in the Ubuntu server version. Today, the company delivered a batch of new computers and planned to install it as a server. Therefore, in order to facilitate the development, I deployed an samba on it to realize the contact between window and linux:

Specific step, I looked at baidu in detail, master gathered, the following is to summarize the experience of the net friend, now write down, after useful need not look for everywhere.

1. Installation of samba:


sudo apt-get install samba 
sudo apt-get install smbfs

2. Create a Shared directory:


mkdir /home/phinecos/share 
sudo chmod 777 /home/Share

3. Create Samba profile:

1. Save the existing configuration file


sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

2. Modify the current configuration file


sudo gedit /etc/samba/smb.conf

Add at the end of smb.conf


[share] 
path = /home/Share # This is the path that I'm going to share  
available = yes 
browsealbe = yes 
public = yes 
writable = yes

4. Create an samba account


sudo touch /etc/samba/smbpasswd 
sudo smbpasswd -a phinecos

You will then be asked to enter the password for your samba account

[if step 4 is not available, you will be prompted session setup failed: NT_STATUS_LOGON_FAILURE]

5. Start, restart and shut down samba server operations

To start the Samba server, simply execute the following command:


#sudo /etc/init.d/samba start 

Shut down Samba server:


#sudo /etc/init.d/samba stop 

Restart Samba server:


#sudo /etc/init.d/samba restart

Test 6.


smbclient -L //localhost/Share

7, use

You can go to windows and type ip for use. In the folder, type "\ "+ "Ubuntu machine ip or hostname" + "\ "+ "share"

Such as:

\\10.126.72.250\Share so we can access our Shared directory Share on the linux system


Related articles: