Samba Setup

Ubuntu Linux Basic Samba Server Setup

Here we are going to cover the absolute basics of setting up an extremely simple Samba share.

Update your repo info and install the Samba package.

apt-get update
apt-get install samba

Generate a new password for the user you intend to use.

smbpasswd -a user1

Backup the smb.conf config file. Edit this file and add a new entry for the share.

cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
vi /etc/samba/smb.conf

Add this snippet at the end of the file to create a new smb share. You can change the variables as needed. You will probably use a different directory for your data and a different user name.

path = /storage1
valid users = user1
read only = no

Restart the Samba daemon to pick up the changes. Make sure it is up and running.

service smbd restart
service smbd status

On your client machine, we can use the following to mount the share to a local directory. We used xxxxxxxxx in place of the password. You will also want to specify the user, server, and directory that you used. This is assuming that you are running Linux on your client/desktop machine. If you are running something else like Windows or OSX, you will access the share a bit differently. Linux should also be able to access the share using most file managers.

sudo mount -t cifs -o vers=1.0,user=user1,pass=xxxxxxxxx \ 
//duck-puppy/storage1 /storage1