Setup Samba on Ubuntu

Updated December 24, 2012. This works on all versions of Ubuntu.

Authenticated network file access is very helpful on your home LAN.


sudo apt-get install samba


sudo nano /etc/samba/smb.conf

Enter details for the share at the end of the file. Leave the rest of the file default for now. Go back later and edit it.

# Name
# Path
# Restrict access. Useful with multiple shares/users.
valid users=user_name,user_name2
# Enable write access.
read only=no

For more options visit the smb.conf man page:

Start Service:

sudo restart smbd

Note: You must restart the samba daemon for any of the above changes to take effect.

Adding users:

sudo useradd user_name --shell /bin/false
sudo smbpasswd -a user_name

Hint: Use your Windows username and password. This will grant password-less access to the share.

For more options visit the smbpasswd man page:

Accessing the share in Windows:

In the address bar of file explorer:


Leave a Reply