How do I set up file sharing between two Ubuntu laptops on my wireless network?
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>
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.
If you do not require encryption you can use python. If you have installed python you can try SimpleHTTPServer. For this
cd /folder/to/share
And then,
python -m SimpleHTTPServer
This will allow sharing through port 8000. The other machine can access the files using http://yourlocalIP:8000
EDIT
Since python2 is stopped support, here is the command to python3
python3 -m http.server
A Quick Way to Share Folders in Ubuntu
Objectives:
Share a folder between 2 Ubuntu using samba PC's
sudo smbpasswd -a USERNAME