Add Samba on Debian

Samba is an open-source utility that enables file sharing between machines running on a single network. It enables Linux machines to share files with machines running different operating systems, such as Windows

Install Samba

apt install samba samba-common-bin -y

Add user

Here I will use root as example. Please be aware of the danger of root user. Use at your own RISK!

smbpasswd -a root

Edit the config

nano /etc/samba/smb.conf

[Public]
path = /root/
read only = No
writable = yes
guest ok = no
force user  = root

Test the connection

# Exec this command and press "enter" button to display entire config
testparm

# You will see something similiar like this.
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed by GnuTLS (e.g. NTLM as a compatibility fallback)

Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
[global]
	idmap config * : backend = tdb


[Public]
	force user = root
	path = /root
	read only = No

Restart the samba service daemon

service smbd restart

Mount with CIFS

mount.cifs -o user=root,pass="your-password" //my.server.com/my-folder mount-folder/

Photo by Luba Ertel on Unsplash