Hussein Bharwani

Setup Samba on Ubuntu

Having access to your files over your home network is invaluable. For example, when using a virtual machine, tablet, or to share photos with family members.

Install:

sudo apt-get install samba


Configuration:

sudo gedit /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
[shared_directory1]
# Path
path=/home/user_name/shared_directory
# 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: http://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html

Adding users:

sudo smbpasswd -a user_name

Note: Use the same username/password for logging into Windows and you will not need to enter the login information when accessing the share (from a Windows machine.)

For more options visit the smbpasswd man page: http://www.samba.org/samba/docs/man/manpages-3/smbpasswd.5.html

Restart Service:

sudo restart smbd

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

Accessing the share in Windows:

In the address bar of file explorer:

\\<ip>\<shared_directory1>

Leave a Reply

*