Access User’s Home Folders via Samba on Ubuntu 17.04 / 17.10

If you want to share Ubuntu home folders, you should install and configure Samba. This brief tutorial is going to show students and new users how to easily install and configure Samba on Ubuntu to share user’s home directories.

Samba is an opensource implementation of the SMB/CIFS services used to seamlessly share files between client computers. Windows systems and many other modern operating systems use it to share files and printers among themselves and others.

When configured correctly, you will be able to access your home folder from Windows or other machines from your file explorer.

To get this working, continue with the steps below:

Step 1: Install Samba

To be able to access your home folder via samba on Ubuntu, you must first install the Samba package. Run the commands below to install Samba.

sudo apt install samba samba-common python-glade2 system-config-samba

Step 2: Configure Samba

Now that Samba and related packages are installed, run the commands below to make a backup of the default Samba configuration file… then follow up with the next commands to create a new Samba configuration file.

sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak

Then create a new Samba configuration file.

sudo nano /etc/samba/smb.conf

Next, copy and paste the content below into the file and save.

#============================ Global definition ================================
 
[global]
workgroup = WORKGROUP
server string = Samba Server %v
netbios name = ubuntu
security = user
map to guest = bad user
name resolve order = bcast host
dns proxy = no

#============================ Share Definitions ============================== 

[homes]
   comment = Home Directories
   browseable = yes
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S
   read only = no

Continue below with the setup.

Step 3: Create Samba user password

At this point, Samaba should be installed and configured to allow users to access their home directories. The final step is to create Samba database for each account on the system.

Run the commands below to create Samba password for the user account named richard

sudo smbpasswd -a richard

You’ll be prompted to create and confirm a new password for the account. Please do.

Repeat this step 3 above for each user.. when you’re done, run the commands below to restart Samba.

sudo systemctl restart smbd.service

Step 4: Access your home folder

Samba is installed and configured.. access your home folder from Windows using the Windows file explorer.

ubuntu samba share

Here’s a trick.. if you use the same username and password as your Windows machine for Ubuntu and Samba.. access should be seamless.

Enjoy!

You may also like the post below:

Getting to Know Ubuntu File System Structure