Setting up Samba service on Linux#
1. Install Samba#
sudo apt update
sudo apt install samba
2. Create a directory for Samba sharing#
mkdir /home/<username>/sambashare/
3. Edit the configuration file#
sudo vim /etc/samba/smb.conf
Insert the following at the bottom of the file
[sambashare]
comment = Samba on Ubuntu
path = /home/username/sambashare
read only = no
browsable = yes
Close and save the file
4. Start the service#
sudo service smbd restart
Open the firewall
sudo ufw allow samba
5. Create a user#
The user to be created should be an existing system username, such as root. The username used in the previous two steps should also be root.
sudo smbpasswd -a username
6. Connect from Windows#
Open the file manager and click on "Map network drive"
Enter the IP address of the SMB server and the desired drive name to map.