Sambashare in linux; share files between any computers.

Samba-share In Linux

[email protected]:~/$ cat Samba-In-Linux

Sambashare; share files between any computers within same network.

How to set up sambashare in linux? (Tested on arch linux)

Install samba in your linux machine according to the distribution you use.

For example:

In debian based distributions: $ sudo apt-get install samba

In arch based distributions: $ sudo pacman -Sy samba

Then take a look at /etc/samba/smb.conf file.
It may or may not exist according to the distribution you use. If it exists, take a backup using $ sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bak.
Then create smb.conf in /etc/samba/ and open with your favourite text editor (for example i use vim here) with sudo access: $ sudo vim /etc/samba/smb.conf and add the following lines.

[name of the folder to share]
comment = File sharing using sambashare
path = full path to the folder to share
browseable =yes
read only = no('yes' if you don't want to give write permission

For Example:

To share the files located in /home/yogesh/FileSharing/, configure the following:

comment = File sharing using sambashare
path = /home/yogesh/FileSharing/
read only = no
browseable = yes

Save the file and then follow the steps below:

Enable and start samba service in your system:

$ sudo systemctl enable smb && sudo systemctl start smb

Add your current (Regular) user to samba and assign password to access the files:

$ sudo smbpasswd -a "username"

For Example: If my regular linux username is yogesh, $ sudo smbpasswd -a yogesh and set the password.

If you use any firewall, allow samba to send and receive files through the firewall.

For Example: If you use ufw firewall, $ sudo ufw allow cifs

You're all set now. Find your ip using ip addr or ifconfig and access the files from any device within same network.

To access the files in windows system, Go to Start --> run --> type \\ip-address --> Ok


Then Enter your username and password you set earlier and access it in file manager.

To access the files in linux system open a file manager that has gvfs support, search smb://(ip-address)in the search bar of file manager, enter the username and password and access the files.

[email protected]:~/$ cd All-Notes

[email protected]:~/$ cd $HOME

[email protected]:~/$ _