Sharing files and folders with Samba – Definitive Guide

[email protected]----------------------
FILE SHARING - WORKAROUND FOR ANTERGOS (AND NOT ONLY)
---------------------------------------------------------------------------------------

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

Verify if you have samba installed...
pacman -Ss samba

if not then install samba...
sudo pacman -S samba

Verify if you have nautilus sharing installed...
pacman -Ss nautilus-share

if not then install nautilus sharing...
sudo pacman -S nautilus-share

Verify if you have gnome share installed...
pacman -Ss gnome-user-share
 
if not then install gnome-user-share...
sudo pacman -S gnome-user-share

stop the following service...
sudo systemctl stop samba
sudo systemctl stop smbd
sudo systemctl stop nmbd

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

if not then copy the file smb.conf.default to smb.conf  (this fix also sharing printer troubleshooting)...
cd /etc/samba
sudo cp smb.conf.default smb.conf

select to 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

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

verifying if the following services is setting to enable...
systemctl is-enabled samba
systemctl is-enabled smbd
systemctl is-enabled nmbd

if not then settings it to enabled (give only the necessary command)...
sudo systemctl enable samba
sudo systemctl enable smbd
sudo systemctl enable nmbd

If you use a firewall (that is recommended) then you must set a couple of ports to allow the Netbios service (nmbd)
to view your PC. Then:

check if you hare gufw installed...
pacman -Ss gufw

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

verify that ufw service is enabled...
systemctl is-enables

if not then enable it...
sudo systemctl enable ufw

then you must enable on 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:
https://help.ubuntu.com/community/Gufw (except for installation instructions that concern to ubuntu).

Now reboot Linux...

then, when your system is ready, try to open nautilus (File)
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

NOTE:
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 5,675 times, 14 visits today)

Pin It on Pinterest

Share This