mikeh.online

Hardware & Software info and projects

Nobara samba share

setup apparmor profile:

sudo aa-complain /etc/apparmor.d/usr.sbin.smbd
sudo aa-complain samba-dcerpcd samba-bgqd samba-rpcd samba-rpcd-classic samba-rpcd-spoolss

install samba and enable:

sudo dnf install samba
sudo systemctl enable smb nmb --now

firewall rules:

sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload

for usershares:

sudo mkdir /var/lib/samba/usershares
sudo groupadd -r sambashare
sudo chown root:sambashare /var/lib/samba/usershares
chmod 1770 /var/lib/samba/usershares

in /etc/samba/smb.conf add:

[global]
usershare path = /var/lib/samba/usershares
usershare max shares = 100
usershare allow guests = yes
usershare owner only = yes

for other shares add:

(replace: NAME, COMMENT, xxxxxxxxxxxxxx)

[NAME]
     	comment = COMMENT
        path = /mnt/xxxxxxxxxxxxxx
        writeable = no
        browseable = yes
        public = yes

Add you user to the sambashare group:

sudo groupadd -r sambashare
sudo gpasswd sambashare -a $USER
sudo systemctl restart smb nmb

Set your samba user and password:

sudo smbpasswd -a $USER

reboot !