Samba is a free and open-source software tool that allows files, printers, and various services to be shared between Linux and Windows clients. In this tutorial, we will guide you through the installation process of Samba on Debian.
Use the following command to update the package list of your system:
sudo apt update
To install Samba, execute the following command:
sudo apt install samba
To configure the Samba service, we need to edit the Samba configuration file. Open the /etc/samba/smb.conf
file with your preferred text editor.
sudo nano /etc/samba/smb.conf
The following section defines the Samba share where files will be hosted. You can use an existing directory or create a new share directory. In this example, we'll create a new directory:
[share]
path = /srv/samba/share
read only = no
browsable = yes
Now, we need to create a new user account for Samba and set up the password.
sudo smbpasswd -a username
Replace the "username" with your preferred username.
By default, Firewall is enabled on Debian, so you need to allow Samba services through it. Use the commands below to add the Firewalld rules:
sudo ufw allow samba
After configuring everything, restart the Samba service to apply the changes.
sudo systemctl restart smbd
Open the File Explorer on your Windows machine and go to "This PC."
In the address bar, type the IP address of the Debian machine (\\<IP address>
).
Enter your Samba credentials to access the shared folder, like:
Username: <username>
Password: <password>
Now, you can access your Samba shares from your Windows machine.
Samba is a powerful tool for sharing files and printers between Linux and Windows machines. In this tutorial, we covered how to install and configure Samba on Debian.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!