top of page

SAMBA CONFIGURATION IN LINUX UBUNTU -16.04.3-server

  • Writer: Sankalpa H.T.S
    Sankalpa H.T.S
  • Jun 19, 2018
  • 2 min read

ree

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.


ree
Samba server – 192.168.100.8

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

ree

Check the installed package:

ree

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.

ree

Add group using below command:

ree

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

ree

Add the user we created to the group we created:

ree

Confirm the user added successfully to the group:

ree

Create Share Folders


In the home folder:

ree

Create a directory named secure:

ree

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

ree

Confirm the ownership changes:

ree

Editing the Configuration File


There is only one configuration file that needs to be taken care of:

ree

The smb.conf file should looks like this:

ree

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

ree

Without comments the file looks like:

ree

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

ree

Open the smb.conf file:

ree

With comments file looks like:

ree

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

ree

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

ree

Now all left to do is to restart samba service:

ree

tail /var/log/syslog :

ree

Service will restart without failed:

ree

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:

ree

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:

ree

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

ree

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

ree

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

ree

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.

ree

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

ree

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

ree

Same as access the secure directory and see.

ree



ree

ree

 
 
 

Comments


bottom of page