Install Samba on Ubuntu 14.04

My neighbours and I watch movies every Thursday night. It’s our sofa night. So I decided to create a file server so that when we can’t make it, we can at least have the movie available for viewing at our leisure.

For this, I used Samba on my Ubuntu 14.04 box and I must admit, the setup was really simple. Here’s what I did to get Samba setup.

First, I installed Samba using the following command: sudo apt-get install samba.

I then opened the Samba config file for editing. Open your config file by using the command: sudo nano /etc/samba/smb.conf.

The only change I made was to add the following at the end of the conf file:

[share]
comment = My File Server
path = /srv/samba/share
browsable = yes
guest ok = yes
read only = no
create mask = 0755

Let me try to explain what this does (to the best of my ability):

  • comment: Just a comment and not necessary for Samba to function
  • path: The path of the folder that you want to share
  • browsable: Whether the folder can be browsed by Windows Explorer (Windows OS)
  • guest ok: Allows users to browse the shared folder without the use of a username and password
  • read only: Gives permissions to the folder and files (I set mine to “no” so after viewing anyone can delete the files)
  • create mask: Determines the permissions that new files will have (I had to go online for this one)

I then did a “chown” so that anyone can access the folder and files: sudo chown nobody.nogroup /srv/samba/share/.

And finally, restart Samba for the configuration to take effect:

  • sudo restart smbd
  • sudo restart nmbd

Keep in mind that this configuration allows anyone full access to your shared folder and files.

So now that you have Samba up and running, have some fun with it. Yay LINUX!

Tags: ,