This guide will walk you through configuring Samba/CIFS shares on your Ubuntu (12.04) server. If all goes well, your Windows computers (as well as Macs) will be able to connect without issue. This guide has steps on how steps on how to set it up in the Desktop and in shell (ubuntu server). You do not need to do both.

Desktop (GUI)

Open the Ubuntu Software Center and search for “Samba”.
Install first the “SMB/CIFS file, print, and login server for Unix” then “Samba”.

Search for the Samba application in Dash Home, open it and when prompted, enter your admin password.

We will need to add a unix user first before making a samba user. You can configure your shares by adding additional users that are allowed to connect to it. All you will need to do is add a standard unix user. In the terminal:

sudo adduser bob

Where bob is the name of the user you would like to create. You will then be prompted to enter the password for the new user you created and optional values for full name, room number, work phone, etc. You can skip these by pressing Enter through each one. The primary user you created when you installed ubuntu will also work.

Back in the Samba Server configuration, go to Preferences > Samba Users.. and click Add User. Select the username you just created under Unix Username. Enter the same username under Windows username (or it can be different, it’s up to you) then enter and confirm the password for that Samba user. The password can also be different than the unix user. You can continue to populate the list of Samba users for your network.

Let’s add our shares. Click the green plus button or go to File > Add Share. Next to Directory, click Browse to go to the folder you want to share. Enter the name under Share Name and a small description right under it. Make sure you select “visible”. You can select Writable if you want the connected users to have write privileges to the share. Click the Access tab and check the boxes next to the names you want to allow. Optionally, you can select “Allow access to everyone”.

Repeat for all the shares you would like to add. Confirm it works by connecting to the server in Windows.

Terminal (Ubuntu Server)

The following are the steps for configuring Samba should you be running Ubuntu server or prefer not to use the GUI. In the terminal:

First, we’re installing Samba then making a backup of the original configuration file. Let’s go ahead and configure Samba.

sudo nano /etc/samba/smb.conf

Generally, the defaults will work. You can always change specific settings in here. For instance, if your workgroup isn’t WORKGROUP by default, then you would specify that in this configuration file. Let’s uncomment one line by removing the semicolon in front of it.

[Storage] – This is actually the name of the share. You can specify the name as you like. Don’t use more than 31 characters and avoid spaces if possible.comment – Optional comment for the share.path – The path to the folder you would like to share.browseable – Specifies that the share will be browseable by all clients.read only – Pretty self explanatoryguest ok – Specify whether you allow guests to connect.create mask – Default permissions for filesdirectory mask – Default permissions for directoriesvalid users – specify the users you would like to be able to connect, separated by comma and a space.