How to configure Samba service on Ubuntu
1. Download the samba server
- Enter the following command to update the current software
sudo apt-get update
sudo apt-get upgrade
- Enter the following command to install the Samba server
sudo apt-get install samba samba-common
Two, configure the samba server
- Add permissions to the shared directory
sudo chmod 777 /home/hispark
- Add user (hispark below is my user name, you will need to set the samba password later)
sudo smbpasswd -a hispark
- Configure the configuration file of sambe
sudo vim /etc/samba/smb.conf
Add the following content at the end of the configuration file smb.conf (hispark is my username)
[hispark]
comment = share folder
browseable = yes
path = /home/hispark
public = yes
available = yes
guest ok = no
writable = yes
valid users = hispark
create mask = 0777
directory mask = 0777
-
After the content is added OK, press
esc
the key of the computer first, and then enter:wq
to exit
-
Restart the samba server
sudo service smbd restart
3. File sharing configuration between Linux system and Windows system
-
Check the IP address of Ubuntu
Enter the following command to install net-tools
sudo apt install net-tools
Enter the ifconfig command to view the IP address of Ubuntu, as shown in the figure below: 192.168.75.129
- In Windows, hold down the win+R key combination, enter
\\192.168.75.129
, and then click OK, the shared directory hispark will pop up
- Map the shared directory of Linux to Windows, select the shared directory of hispark, and right-click to select Map Network Drive
- After clicking Finish, a login window will pop up, enter the account and password, and then click OK to start mapping
- In this way, all the files of the Linux server can be mapped to Windows for access.