Sharing files and folders with Samba – Definitive Guide

Sharing files and folders with Samba – Definitive Guide


by Flavio Antonini - 2016 - last update: june 11 2016

~ edited by joekamprad (january 2018)

~ last edited by joekamprad | formatting shorten and expand | (february 2018)


Install samba and needed apps:
sudo pacman -Ss samba nautilus-share gnome-user-share gvfs-smb

stop the samba smbd nmbd services...

sudo systemctl stop samba smbd nmbd



verify if smb.conf file exist...
ls /etc/samba

if not then copy the file examples/smb.conf from to smb.conf  (this fix also sharing printer troubleshooting)...

Just take this content.;a=blob_plain;f=examples/smb.conf.default;hb=HEAD

and place the file in /etc/samba/smb.conf

Under GNOME you need to put off sharing personal files like this:

switch OFF Sharing Personal Files on Sharing under System Settings...
System Settings --> Sharing --> Sharing Personal Files --> OFF

create a group sambashare...
sudo groupadd -r sambashare

create usershare folder...
sudo mkdir -p /var/lib/samba/usershare

change group of usershare folder...
sudo chown root:sambashare /var/lib/samba/usershare

change mode w/sticky bit on usershare folder...
sudo chmod 1770 /var/lib/samba/usershare

verify if your user is in samba DB...
sudo pdbedit -L -v

if not then add your user to samba (then create new sharing password)...
sudo smbpasswd -a <your-user>

then add you user to sambashare group:
sudo gpasswd -a <your-user> sambashare

edit smb.conf...
sudo gedit /etc/samba/smb.conf

Use editor you want instead of gedit nano will be easy to and runs inside terminal.

uncomment following line in /etc/samba/smb.conf file under [global] settings section...
include = /etc/samba/smb.conf.%m

add following lines at the end of [global] section of smb.conf file then save file and exit gedit...

usershare path = /var/lib/samba/usershare
usershare max shares = 100
usershare allow guests = yes
usershare owner only = yes


make sure following services are enabled (to start at boot):
sudo systemctl enable samba smbd nmbd


If you use a firewall (what is recommended!) then you must set a couple of ports to allow the Netbios service (nmbd) to reach your PC.

Check if you have gufw installed...
pacman -Qs gufw

if not then install it...
sudo pacman -S gufw

then enable it...
sudo systemctl enable gufw

Now you must enable the firewall following ports related to nmbd service:
137/udp to everyone
138/udp to everyone

and following ports related to smbd service:
139/tcp to everyone
445/tcp to everyone

For firewall settings and troubleshooting see internet documentations: (except for installation instructions that concern to ubuntu!!).

Now reboot system...

For Gnome:

then, when your system is ready, try to open nautilus (Files)
choose a folder to share, right click on it, then
choose Properties --> Sharing and check Sharing this folder...

now - for test - view network resource in nautilus, click on icon with
your PC name, click on it, then click on shared folder and enter
the sharing password previously set...

...and joy


For XFCE use thunar and make sure you have package: thunar-shares-plugin installed...

As we figure out here it works for XFCE:



1) Sometimes sharing is not immediately, and take some time to work after boot.

2) If you uncheck "Sharing this folder", then you must click on unmount symbol
on nautilus tree to uncouple sharing.

(Visited 11,207 times, 1 visits today)

Pin It on Pinterest

Share This