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 /mnt/ssd1/1TBsamba
chmod -Rv 755 /mnt/ssd1/1TBsamba
chown -Rv nobody:nobody /mnt/ssd1/1TBsamba
chcon -u system_u -t samba_share_t -v /mnt/ssd1/1TBsamba
Backup existing configuration
mv /etc/samba/smb.conf /etc/samba/smb.conf.bak
Edit the file /etc/samba/smb.conf
# This configuration is taken from here

[global]
map to guest = Bad User
log file = /var/log/samba/log.%m
log level = 1
max log size = 1000
logging = file
server role = standalone server
server string = Samba Server %v

[Public]
path = /mnt/ssd1/1TBsamba
read only = no
guest ok = yes
guest only = yes
Check if smb.conf is correct with:
testparm
Activate the services
systemctl start smb.service
systemctl start nmb.service

systemctl enable smb.service
systemctl enable nmb.service

systemctl status smb.service
systemctl status nmb.service
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: \\192.168.0.220
samba windows client


Access the share on Linux with: smb://192.168.0.220
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