Share a folder between two Linux machine

Many ways, one way

On GNU/Linux systems, there are many ways to share disks and folder between machines. Personally, I have founded that Samba Share (SMB) is a nice and fast way to share disks and folders also to different operating systems.

NFS is often used with Unix operating systems, but SMB and NetWare Core Protocol (NCP) occur more commonly than NFS on systems running Microsoft Windows; AFP occurs more commonly than NFS in Macintosh systems. On Linux, you can use all this network sharing file system, but SMB is convenient, fast and readable by all. (And this is incredible because SMB originated from Microsoft Corp.)

The Samba Sharing System

Samba is the standard Windows interoperability suite of programs for Linux and Unix. Samba is Free Software licensed under the GNU General Public License, the Samba project is an example of stable and fast file and print services. SMB is a protocol that permit to share files across many operating systems, such as DOS and Windows, OS/2, Linux, Mac OS X and many others.

Samba is the standard Windows interoperability suite of programs for Linux and Unix
Samba is the standard Windows interoperability suite of programs for Linux and Unix

So Samba is not the most adopted world standard(near be!), but it’s useful and easy to integrate in your environment.

Share a folder between two machine

To install Samba, open terminal console and type:


sudo apt-get install samba

Make a backup of the configuration file:


sudo cp -p /etc/samba/smb.conf /etc/samba/smb.conf.orig

Edit the configuration file:


sudo gedit /etc/samba/smb.conf

After the section ‘Share Definition’, add the following istructions:


[Samba_Shared_Folder]
path = /home/Path_to_Samba_Shared_Folder
available = yes
browsable = yes
public = yes
writable = yes
create mask = 0777
directory mask = 0777

Now restart the Samba services(I mean all the Samba services!):


sudo /etc/init.d/samba restart

In fact, on Ubuntu 15.04(or any other Linux distribution) you can type this to force the restart only of the smbd(samba daemon) service:


sudo service smbd restart

And finally access to shared folder from another machine:


for example, on Nautilus click on 'Browse Network' > 'Windows Networks' > 'WorkGroup' > 'Shared Folder' and access to your Samba Shared Folder over your network.

Enjoy it!

Leave a Reply

Your email address will not be published. Required fields are marked *