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"
![image](/_next/image?url=https%3A%2F%2Fvip2.loli.io%2F2022%2F07%2F16%2Fq2v93BNmQuWEfoD.png&w=3840&q=75)
![image](/_next/image?url=https%3A%2F%2Fvip2.loli.io%2F2022%2F07%2F16%2F9GS8hYX5OCRPJfg.png&w=3840&q=75)
Enter the IP address of the SMB server and the desired drive name to map.