How to share files with Samba
This is my samba setup in which I have a server and the server root is shared with other clients on my local network. I have used this setup in Debian Bullseye and Debian Bookworm/testing.
For other ways transfering files, read how to transfer files between devices
Server setup:
apt-get install samba
Edit /etc/samba/smb.conf to share the server root:
[homes]
browseable = yes
read only = no
create mask = 0755
directory mask = 0755
;*******************SHARE ROOT*****************
[root]
comment = root
path = /
valid users = myusername
read only = no
create mask = 0765
Restart the samaba server:
systemctl restart smbd.service
Create a samba password for myusername:
smbpasswd -a myusername
Client setup
Install mount.cifs:
apt-get install cifs-utils
Add the shared drive in /etc/fstab:
//SERVER_IP_ADDRESS/root /mnt cifs noauto,user,username=myusername,password=mypassword 0 0
Mount the shared drive in the client:
mount /mnt
hashtags: #linux #samba