How to Share Files on a Linux Network, Part I

You have an Ubuntu Linux network, or at least 2 computers running Ubuntu Gnu/Linux and you would like to share files between them, either on a LAN, or across the Internet. In this guide a method of sharing files using ssh will be used; this method could be used with Windows as well, but unless one has a reason for sftp file sharing with a Windows OS, the better solution there would be Samba; look in the Tutorials area of this site for a guide on how to use Samba to share files between networked computers running a mix of Ubuntu Gnu/Linux and Windows.

One of the things I like about using SSH for sharing files on a network of Ubuntu Gnu/Linux computers is that it requires very little in the way of setting up; indeed, just one small package install, discover IP address's and were ready to share files; another is it can be a very secure way of transporting files.

Install the required SSH package

On a typical Ubuntu Linux install all machines that you want to send/recieve files to/from will require an additional package to be installed.

Open a terminal: Applications>Accessories>Terminal

Paste the following code into a terminal.The terminal.


sudo apt-get install ssh


Finding your local IP using the terminal

If you are on a Local Area network then you can discover your Local IP address using either the Command Line Interfaces through a terminal,


ifconfig eth0 | grep 'inet addr:'


or by using your windows manager GUI.

Finding your local IP using the GUI

Right click on Network Manager Applet; then Left click on Connection Information from the drop down dialogue box.  Your I.P. address will be at the top of the list.

Network Manager Applet.Connection information.

If you would like to share files with a computer outside your Local Area Network you will need its Wide Area Network(WAN) address, and if the remote computer is behind a router you will need to forward port 22 to its LAN IP, for your convenience I have included a script that will show you your current WAN address. I may at some point write a guide to setting up an ssh tunnel; but, serious sftp filesharing over a WAN is really mostly outside the scope of this tutorial.

Start up the Nautilus File Manager/Browser

So now we have the IP address of the machine we wish to share files with, so now we'll fire up Nautilus. I use the Gnome Desktop, if you use KDE, XFCE4 or some other Desktop manager, the guide should work for you as well, just open the Fie Manager/Browser that is in use by your Window Manager. On Ubuntu using Gnome you access Nautilus by clicking on Places>Home Folder  Theres no place like home...

Browse to the Remote Computer

Now we simply browse to the remote computer, in much the same way we would browse to a website.Theres no place like 127.0.1


ssh://username@i.p.address


Press Enter and a Password Request will pop up.Password notification popup

Enter your password, click Connect, and you will be mounted to the remote computer's filesystem.

Now you may browse, modify, create, or delete files with all the same permissions as the user you are logged in as. One can setup directories especially for remote filesharing with permissions set for a more secure situation. I will write that up in Part II of this guide. 

Enjoy


How to Share Files on a Linux Network, Part II

Coming Soon