Share HDD in network

Hello,

Install Samba

Update your system

Update your system before installing Samba. Run below command to update your system.

sudo apt update && sudo apt upgrade -y

Install Samba

To install Samba, use the following command.

sudo apt install samba cifs-utils -y

Configure Samba

Samba’s configuration file is located in /etc/samba/smb.conf. You can customize it by editing this file.

Edit configuration file

Edit Samba configuration file and add the lines given in next step.

sudo nano /etc/samba/smb.conf

2. Setup shared directory

Add the following section at the end of the file and save your configuration file.

[SharedFolder]
path = /path/to/shared/folder
browseable = yes
writable = yes
guest ok = no
read only = no

Replace /path/to/shared/folder with the folder path you want to share.

Note: If you have made any changes to the configuration file, you have to restart Samba service.

Create a Shared directory

If the given folder in the configuration file doesn’t exist, you have to create it and want to apply proper permissions.

 mkdir -p /path/to/shared/folder
 chmod -R 775 /path/to/shared/folder

Add a Samba User

sudo adduser <username>
sudo smbpasswd -a <username>

Note: Ensure the password is set for both the system and Samba.

Start and Enable Samba service

Restart Samba

Once the changes are made, restart samba using the following command.

sudo systemctl restart smbd

Enable Samba to start on Reboot

sudo systemctl enable smbd

Check Samba Status

sudo systemctl status smbd

You can after install Nautilus Share to share a folder with right click in file manager

sudo apt install nautilus-share
2 Likes