Transferring files between 2 remote linux virtual machines

Posted on

Problem :

Me and my friend are trying to transfer files remotely using scp. We have both installed ssh server and turned it online but when trying to use the command nothing happens.
I am trying to transfer using his public ip.
It says it is listening on port 22, but I don’t know what is the problem.

Solution :

You need to do three things:

  1. Make sure in VirtualBox the network of the VM is set to bridged (you need to shut down the VM for this first). This will make the VM appear as a separate computer on the network, and make connecting to it more transparent.
  2. Check the IP address of the VM (e.g. by running ip a inside the VM in a terminal)
  3. Login to the web interface of your router and add a port forward to the IP you found and port 22.

Now you should be able to login from a remote host with ssh on your external IP (not the same as the VM’s IP!).

Leave a Reply

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