Creating a Samba File Share Server with Ubuntu

Ubuntu When I get the chance to work with Linux and dealing with the server side of the Linux world. I jump right to it with no hesitation; I was given the assignment to create a Samba file share server. Ubuntu Server OS was the first thing that came to my head. Creating a Samba server is one of the most common ways to network Linux and Windows computers. A video was posted at my YouTube channel, so I apologize for the craziness and loudness within the video [the very beginning of my YouTube startup]. I also posted the step-by-step instructions below the video if you can't bare the loudness.

First step is to install the Samba package on the machine. Within your terminal prompt you will need to enter the following:

sudo apt-get install samba

Time to configure your Samba server. Samba has a main configuration file which is located in /etc/samba/smb.conf. The default configuration file has a significant amount of comments in order to document various configuration directives, so remember what you un-comment or change.

Within your terminal prompt type in the following:

sudo nano /etc/samba/smb.conf

First thing to edit is in the [global] section in the /etc/samba/smb.conf:

workgroup = EXAMPLE


security = user

The security parameter is farther down in the [global] section, and is commented by default. Also, change EXAMPLE to better match your environment – such as the domain name.

Now, go to the bottom of the smb.conf file and create a new section, or uncomment one of the examples, for the directory to be shared:


comment = Ubuntu File Server Share

path = /srv/samba/share

browsable = yes

guest ok = yes

read only = no

create mask = 0755

Note – If you wondering about the path – its the path to the directory to share.

Technically Samba shares can be placed anywhere on the file system as long as the permissions are correct, but adhering to standards is recommended.

Here is the break down of each attribute used to create the share folder:

browsable: enables Windows clients to browse the shared directory using Windows Explorer.

guest ok: allows clients to connect to the share without supplying a password.

read only: determines if the share is read only or if write privileges are granted. Write privileges are allowed only when the value is no, as is seen in this example. If the value is yes, then access to the share is read only.

create mask: determines the permissions new files will have when created.

Now that Samba is configured, the directory needs to be created and the permissions changed for your users to get access to your Samba share. From a terminal enter the following, but remember you can place the folder anywhere:

sudo mkdir -p /srv/samba/share

sudo chown nobody:nogroup /srv/samba/share/

The -p switch tells mkdir to create the entire directory tree if it doesn’t exist.

Finally, restart the samba services to enable the new configuration:

sudo restart smbd

sudo restart nmbd

That’s it you should be up and running with your Samba File Share Server.

About BjTechNews (879 Articles)
An IT guy trying to learn everything about technology and sharing it with you all. I'm a blogger and video blogger who highlights daily news in the tech industry, promoting tips and hacks for fellow techies.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s