约珞亚

约珞亚

网络世界的辩证唯物主义者

Setting up SMB service on Linux

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 image

Enter the IP address of the SMB server and the desired drive name to map.

  1. Official Ubuntu tutorial
  2. CSDN
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.