Skip to content

Samba sharing

by joekamprad


Install samba and needed apps:
sudo pacman -S samba gvfs-smb --needed

stop the samba smb nmb services…

sudo systemctl stop samba smb nmb


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

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-name"

if you would prefer to use tdbsam rather than smbpasswd:
sudo pdbedit -a -u "your-user-name"

then add you user to sambashare group:
sudo gpasswd -a "your-user-name" sambashare

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

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

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

if you are using tdbsam rather than smbpasswd uncomment the line in /etc/samba/smb.conf file under [global] settings section…
passdb backend = tdbsam

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

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 smb nmb


If you use a firewall (which is recommended!) then you must set a couple of ports open 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 ufw

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 the system…

For Gnome:

sudo pacman -S nautilus-share gnome-user-share

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

System Config Samba:

  • The Samba configuration tool by Red Hat

is also working on an Arch-based distro like EndeavourOS:

To build and install it from the AUR:

yay -S system-config-samba

Get config available:;a=blob_plain;f=examples/smb.conf.default;hb=HEAD

copy from the website and paste it inside this file:

sudo nano /etc/samba.conf

save with [Ctrl+o] end exit with [ctrl+x]

then start and enable (to get it started automatic on boot)

sudo systemctl start samba smb nmb

sudo systemctl enable samba smb nmb

Now you can use system-config-samba!


1) Sometimes sharing isn’t working immediately, and it takes some time to work after boot.

2) We advise to use Samba only if necessary, like in a home server environment or NAS, or to connect to a Windows system. It is more stable to use NFS that is already integrated with the Linux kernel.

Connect with us:

Samba sharing

  • by
%d bloggers like this: