
How to Share Folder in Linux with Windows 10
In this video I show how to install and configure Samba on Ubuntu Linux for the purpose of accessing it from my Windows 10 client. I use this exact configuration on my home server for all shared files on my network. It is very reliable and backed with a ZFS mirror its also resilient to disk failures.
For configuring ZFS pools and volumes, check out my ZFS video first!
----------------------------
# apt install samba
# groupadd share_users
# useradd --groups share_users --password mypass --user-group --no-create-home --shell /usr/sbin/nologin test
# smbpasswd -a test
# ls -la /var/lib/samba/private/
# vim /etc/samba/smb.conf
[share]
path = /datastore/share
valid users = @share_users
writable = yes
browseable = yes
read only = no
create mask = 0770
directory mask = 0770
guest ok = no
force group = share_users
hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/
[test]
path = /datastore/test
valid users = test
writable = yes
browseable = yes
read only = no
create mask = 0770
directory mask = 0770
guest ok = no
force group = share_users
hide files = /$RECYCLE.BIN/System Volume Information/desktop.ini/thumbs.db/
# mkdir /datastore/test
# mkdir /datastore/share
Reset permissions on share folders
# vim resetprm.sh
setfacl -b -R test/
chmod 770 -R test/
chmod 770 -R share/
chown -R test:share_users share/
chown -R test:share_users test/
# chmod +x ./resetprm.sh
Add user to Windows if you want
# net user test mypass /ADD
Restart Samba daemons
# systemctl restart smbd
# systemctl restart nmbd
Check firewall
# ufw status
# ufw allow 'Samba’