Back to main index

Samba Server

For more options read the full tutorial here

Install Samba
dnf install samba samba-common samba-client
Setup the share location
mkdir -pv /srv/samba
chmod -Rv 777 /srv/samba
chown -Rv nobody:nobody /srv/samba
chcon -u system_u -t samba_share_t -v /srv/samba
Backup existing configuration
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Edit /etc/samba/smb.conf
See example
[global]
    unix charset = UTF-8
    workgroup = SAMBA
    security = user
    map to guest = Bad User

[Public]
    path = /srv/samba
    writeable = yes
    guest ok = yes
    guest only = yes
    force create mode = 777
    force directory mode = 777
Check if smb.conf is correct with:
testparm -s
Activate the services
systemctl enable smb nmb
systemctl start smb nmb
systemctl status smb nmb
Allow samba ports in firewalld
firewall-cmd --permanent --add-service=samba
firewall-cmd --reload
firewall-cmd --list-services
Allow samba ports in iptables
# Open Samba ports for everybody from LAN
iptables -A INPUT -s 192.168.0.0/16 -p udp -m udp --dport 137 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/16 -p udp -m udp --dport 138 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/16 -p tcp -m tcp --dport 139 -j ACCEPT
iptables -A INPUT -s 192.168.0.0/16 -p tcp -m tcp --dport 445 -j ACCEPT

i6ptables -A INPUT -s fe80::/10 -p udp -m udp --dport 137 -j ACCEPT
ip6tables -A INPUT -s fe80::/10 -p udp -m udp --dport 138 -j ACCEPT
ip6tables -A INPUT -s fe80::/10 -p tcp -m tcp --dport 139 -j ACCEPT
ip6tables -A INPUT -s fe80::/10 -p tcp -m tcp --dport 445 -j ACCEPT


Access the share on Windows with Explorer
samba windows client


Access the share on Linux with Thunar
samba linux client


Access the share on Android with
samba android client


To share a Private folder and protect it with a password, read the second part of the tutorial


Back to main index