How to configure Samba service on Ubuntu

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

insert image description here

Two, configure the samba server

  • Add permissions to the shared directory

sudo chmod 777 /home/hispark

insert image description here

  • Add user (hispark below is my user name, you will need to set the samba password later)

sudo smbpasswd -a hispark

insert image description here

  • 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 escthe key of the computer first, and then enter :wqto exit
    insert image description here

  • Restart the samba server

sudo service smbd restart

insert image description here

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

insert image description here

Enter the ifconfig command to view the IP address of Ubuntu, as shown in the figure below: 192.168.75.129

insert image description here

  • 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

insert image description here

  • Map the shared directory of Linux to Windows, select the shared directory of hispark, and right-click to select Map Network Drive

insert image description here

  • After clicking Finish, a login window will pop up, enter the account and password, and then click OK to start mapping

insert image description here

  • In this way, all the files of the Linux server can be mapped to Windows for access.

insert image description here

Guess you like

Origin blog.csdn.net/Wu_GuiMing/article/details/115031721