Configure Samba Home Share

Samba Shares

Before you configure Samba home share make sure to install Samba on Arch Linux or install Samba on Ubuntu Linux. You will also want to configure Samba home shares. By default user home directories are made available as shares for each user of the same name. This means that if your requirements are only to share UNIX user home directories then you don’t need to make any changes outlined below.

 

Edit samba configuration file.

sudo nano /etc/samba/smb.conf

Scroll down quickly by holding CTRL + V.

 

Configure Home Share

You can edit the existing definition or comment it out and create your own. I opted to comment the default definition and add a new definition to the end of the file for clarity and easier management.

#[homes]
#comment = Home Directories
#browseable = no
#writable = yes

 

I will be creating separate directories for users on a storage volume as opposed to on the system volume. Alternatively, UNIX home directories could also be re-mapped to a different volume but this has a number of disadvantages. For one if a volume is on a different physical device certain system activity would cause that device or devices to become active and use more power, cause unnecessary wear and create noise. Another disadvantage is that some system files would be stored on a different device making removal of or changes to the storage volume less straight forward.

 

Create user home directories.

mkdir /mnt/virtual/homes
mkdir /mnt/virtual/homes/user

Each user should have it’s own directory or the share will fail to open in network view.

 

Add the homes section to the end of the file. Note that the share has to be named homes to work though it is not case sensitive.

[Homes]
browseable = no
writable = yes
path = /mnt/virtual/homes/%S

The browseable option set to no means that the homes share will not appear in the network list. This is normally desirable as it would contain the same files as the share named after the currently logged-in user. Option writable set to yes enables write access to the share. The path option sets the absolute location of the user directories with the %S macro mapping to the specific users sub directory.

 

Optionally also configure Samba public share.

Finish the installation of Samba on Arch Linux or Samba on Ubuntu Linux.

 

Quick Reference

sudo nano /etc/samba/smb.conf
mkdir /mnt/virtual/homes
mkdir /mnt/virtual/homes/user

Optionally also configure Samba public share.

Finish the installation of Samba on Arch Linux or Samba on Ubuntu Linux.

  • 3Good5U

    Great and very clear post !