====== Samba File Server ======
===== Installation =====
- apt-get install samba samba-common cups smbclient
- Add user to list of samba users:smbpasswd -a user
- Check whether samba user has been created with:pdbedit -L -v
- Change/verify the following entries in __/etc/samba/smb.conf__ under [global]:workgroup = yourworkgroup
server role = standalone server
map to guest = bad user
- Add the following entries in __/etc/samba/smb.conf__ under [global] below workgroup:server string = Samba Server %v
netbios name = machinename
security = user
- Modify entries under [homes]. This allows home directories to be shared read-only, with "user" having read/write access:browseable = yes
read only = yes
write list = user
create mask = 0600
directory mask = 0700
- Set up a file space share under [yourshare] which is named "yourshare".
- Restart samba or the 2 samba services:/etc/init.d/samba restart
systemctl restart nmbd.service
systemctl restart smbd.service
===== Useful commands =====
* Find computers and shares on the network:smbtree -b -N
smbtree -b -U user%passwd
smbclient -L machinename [user]
smbstatus --shares
* Connect a share:smbclient //machine/share -U user%passwd
===== Links =====
* [[https://www.howtoforge.com/tutorial/debian-samba-server/|Samba Standalone Server Installation on Debian 9 (Stretch)]]
* [[http://linux-training.be/networking/ch21.html|samba securing shares]]
* [[https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html|smb.conf]]