SAMBA CONFIGURATION IN LINUX UBUNTU -16.04.3-server
- Sankalpa H.T.S
- Jun 19, 2018
- 2 min read

In this document, we’re going to learn how to install and configure a samba server on Ubuntu 16.04. Samba is a free and open-source SMB/CIFS protocol implementation for Unix and Linux that allows for file and print sharing between Unix/Linux and Windows machines in a local area network.

Samba is included in most Linux distributions. First update and To install Samba on Ubuntu, simply run:

Check the installed package:

Creating an User and a Group
Samba by default sets user as the security mode which means clients must enter a user name and password for a shared folder. We will create a password disabled user and afterwards we will add a password for samba access.

Add group using below command:

Check whether the user and group are added by looking /etc/passwd file and /etc/group file as below:

Add the user we created to the group we created:

Confirm the user added successfully to the group:

Create Share Folders
In the home folder:

Create a directory named secure:

Change the ownership of the secure directory as amaa:secure:

Confirm the ownership changes:

Editing the Configuration File
There is only one configuration file that needs to be taken care of:

The smb.conf file should looks like this:

Below command is to see configuration file without comment lines (‘#’ is used for comment lines).

Without comments the file looks like:

Copy the configuration file as smb.conf.backup and start editing smb.conf file:

Open the smb.conf file:

With comments file looks like:

Add the pointed blocks [amaa] and [secure] with pointed configuration lines:

You also need to set a separate Samba password for the new user with the following command:

Now all left to do is to restart samba service:

tail /var/log/syslog :

Service will restart without failed:

Accessing Samba Shared Folder From Windows
On a Windows computer that is in the same network, open file explorer and click Network on the left pane. You will see the samba server. Double click the shared folder and enter the username and password.
Accessing Samba Share Folder From a Ubuntu Computer
In our file manager we can see the place that saying connect to server as pointed, Type the smb://192.168.100.8 and click Connect button:

We will be logged to the windows with our shared directories we added to the samba server’s smb.conf configuration file. Try to open the amaa directory:

Change the default entries to the user you created and with the password you created for samba share access:

In amaa directory we can find the file which I already created in that:

We can copy it as below to the other directory on our remote machine as below:

Open that file in the amaa samba access directory and add a entry and save. We are going to look at whether that change will be applied inside the samba server /home/amaa/smb_amaa.txt file.

Go to the samba_server and using cat command check the change:

Here we can find that change has been applied to the smb_amaa.txt file as below:

Same as access the secure directory and see.



Comments