Samba File Server

apt-get install samba smbfs

note: smbfs is replaced by cifs-utils in Debian 8.

After installation, modify the /etc/samba/smb.conf file and set up your file shares.

Add a line after “security = user” to make it look like this:

security = user
username map = /etc/samba/smbusers

This will set Samba to use the smbusers file for looking up the user list.

Add the following line to smb.conf to force SMB2 protocol:

protocol = SMB2

Create a Samba User

There are two steps to creating a user. First we'll run the smbpasswd utility to create a samba password for the user.

  sudo smbpasswd -a <username>

Next, we'll add that username to the smbusers file.

  sudo vim /etc/samba/smbusers

Add in the following line, substituting the username with the one you want to give access to. The format is <ubuntuusername> = “<samba username>”. You can use a different samba user name to map to an ubuntu account, but that's not really necessary right now.

  <username> = "<username>"

Now you can create samba shares and give access to the users that you listed here.

Useful commands

Find computers and shares on the network:

smbtree -b -N
smbtree -b -U user%passwd

Connect a share:

smbclient //machine/share -U user%passwd