2

Is there a way to share/transfer files between two different computers not on same network using samba or any other tool.

Eg. Sharing a movie with a friend.

4 Answers4

2

You're not on the same LAN, so you need to send it over the Internet, and therefore need to use a file transfer service such as Dropbox, MEGA, Google Drive or many, many competitors. You upload the file, select Share and send them a link to the file.

Alternatively, you could install Samba and Apache on your machine, so Samba can deliver the file to Apache and your friend could pick up the file by selecting it for download from your web page made visible by Apache. Sharing files over Internet has specifics, but the first method is easier.

K7AAY
  • 17,202
2

Another option.

Install and default configure ssh server:

sudo apt-get install openssh-server
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.original
sudo chmod a-w /etc/ssh/sshd_config.original

Open port 22 on the host machine.

sudo ufw allow 22

You now have an ssh port open on 22 with the ssh server setup.

Find the local address something like 192.168.0.xx with:

ifconfig

Forward/open a port on your router admin page. e.g. (192.168.0.1) to port 22 on your Ubuntu box. This will vary on the model of router that you have. It will look something like this:

enter image description here

You could give your friend the username, password, and router IP address (http://www.whatismyip.com/).

Your friend can then download filezilla and navigate your computer for any files by typing in the IP address of your router.

enter image description here

This may be a security issue if you have private information on the box. Or you could setup a separate user with restricted access, and RSA authentication.

Could also use this with scp

jmunsch
  • 2,213
  • 1
  • 22
  • 29
  • 1
    This will do the trick if you want to only occasionally share files. Make sure to turn this off when you aren't using it, ssh will give full access to anyone who guesses your name and password. – David Oneill Jan 09 '14 at 19:51
  • Also, if you are planning on using this, sshfs is a really nifty program that lets you mount a shared folder via scp connection. Make sure you have security really tight if you're going to be using this long-term. – David Oneill Jan 09 '14 at 19:52
2

BitTorrent Sync is a program for doing what you described. It works a bit like DropBox except that since there is no centralized server, there are no size or bandwidth limits, and no corporate oversight about what files are shared.

www.bittorrent.com/sync‎

It allows you to share a folder with another computer anywhere on the internet that has the same secret. This will work even if your IP address changes, so if you're wanting to keep the folders in sync over a longer period of time, it is a more convenient solution than using ssh.

I use it to share pictures and videos with my family (we live across several different states).

~~Step by step instructions~~

Download and install the program on all computers.

On the computer that currently has the files, add the folder using the "Generate a secret" choice.

On the other computers, create a new folder, using the secret generated on the previous folder. In Linux, they don't yet have a fancy GUI, so just browse to localhost:8888 to access the control panel.

Depending on your network set up and firewall, you may need to open ports to allow the sync traffic to go through.

Let me know if you have any other specific questions - I have this running on two Ubuntu computers, 2 windows ones and 1 Mac in 4 different locations.

One weird note I thought I'd share because it took me a long time to figure out - be aware of different OS's rules regarding filenames. OSX has case insensitive fileanes, so File.txt and file.txt can't be in the same folder - they can in linux. So if you have any files where the name differs only by case, btsync can't send them (and unfortunately doesn't give you a useful error message why it's not working)

David Oneill
  • 12,144
0

You can install OwnCloud on one of the machines and/or clients or using browser to access the files.

enter image description here

jet
  • 7,274