Install Samba on Arch Linux

Install Samba on Arch Linux

Samba is a software re-implementation of windows SMB networking protocol. I allows sharing files over the network and is widely supported by both Windows and Linux based operating systems. Once it is installed you can configure Samba shares, create Samba public share and setup Samba home share.

 

Install Samba

Install the package with pacman.

sudo pacman -S samba

 

Copy the example configuration file.

sudo cp /etc/samba/smb.conf.default /etc/samba/smb.conf

Configure Samba

Configure Samba shares and optionally configure Samba home share and Samba public share.

 

Check the configuration file for syntax errors.

testparm

 

Create a Linux user that you want to give access to the shares or use an existing one.

sudo useradd dom

 

Create an account with the same username as the Linux username.

sudo pdbedit -a -u dom

Enter the password when prompted. This will be used to login when browsing shares. It does not have to be the same as the Linux user’s password.

 

Change the password at any time if needed.

sudo smbpasswd samba_user

 

Restart the service to apply new changes.

sudo systemctl restart smbd nmbd

 

Run Samba

Start the services with systemd.

sudo systemctl start smbd nmbd

 

Enable the service to run on boot with systemd.

sudo systemctl enable smbd nmbd

dom