Thursday, 27 April 2017

Xubuntu 14.04 Samba setup for access by ubuntu and windows clients

Xubuntu 14.04 Samba setup for access by ubuntu and windows clients


Setting up a samba server locally was done as follows on ubuntu 14.04. On the server I had some errors with missing dependencies and had to perform some purges on samba packages to resolve them.

Reading this, this and this  helped.

Samba Server setup  


On the samba server, run the following:
sudo apt-get install samba samba-common system-config-samba gksu
I received errors that certain samba package dependencies could not be met, and searching for a fix led me to do this:

sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update
sudo apt-get upgrade
sudo apt-get purge samba-common
sudo apt-get purge samba-libs
On xubuntu, could not find the samba config GUI from the menu, turns out I had to run it like this:

gksu system-config-samba

At this point in time I configured the share and user. 

Samba Client (linux)


On the first client, an ubuntu machine, I ran the following to get configured

sudo apt-get install samba cifs-utils

Create a credentials file so that the user and password is not littered everywhere

sudo nano /etc/samba/user
Add these:
username=samba_user
password=samba_user_password 

Set permissions to ro:

sudo chmod 0400 /etc/samba/user
Then edit /etc/fstab, add this entry as a new line to mount on boot:

sudo cp /etc/fstab /etc/fstab.bak1
sudo /etc/fstab

Add this line:

//samba-server/share  /media/share  cifs  credentials=/etc/samba/user,noexec  0 0
Either reboot or mount and you should be in:
sudo mount /media/share/

Samba Client (Windows)


Easy really, just open explorer and go to the network share \\samba-server\share\, enter the samba user and password and you're in.

@quintes