Ubuntu – How to set up file sharing between two Ubuntu laptops on the wireless network

file-sharingnetworkingsamba

I have two laptops running Ubuntu 12.04. Both connect to the same WIFI network to access internet.

How do I connect them to each other so that I can access files on one from another and vice versa?

Also, how do I manage the user permissions, etc. on them?

Best Answer

Share files between 2 Ubuntu computers

If you have two computers running Ubuntu on the same network, it would be an good idea to use openssh to share files between them.

On the server (the computer with the files you want to access), run:

sudo apt install openssh-server

On the client you should have ssh installed already (if for some reason it's not install, run sudo apt install openssh-client).

Then you need to figure out the IP of the computer you want to connect to. Most of the time it's something like 192.168.1.x. To find out the IP, run ifconfig and look for the "wl..." interface (or "eth..." if you're connected over Ethernet cable).

On the client, open Nautilus (Super+E) and go to “File -> Connect to Server”.

Enter sftp://<the_IP_of_the_server>

Ubuntu 16 Connect to Server dialog

On older version of Ubuntu, you could pick the folder you wish to share. As of Ubuntu 16, if you don't specify a path after the IP, you'll get the home directory. For a specific directory outside of the home dir of the user you're connecting as, you need to type its path.

Note that it could take some time to connect, depending on the size of the folder directory.

You'll be prompted for the user/password of the computer you want to connect to.

The name of the directory will become a bookmark in Nautilus.

You should have read/write permissions.

Related Question