This tutorial shows a way to move data around between Research Cloud workspaces.

This method makes use of the ssh-related scp command, in the commandline.

For this exact example, at least the target machine should be a Linux workspace.

Situation

You have two VMs, "VM_a" and "VM_b".

You want to scp data from VM_a to VM_b.

From your local computer, you can ssh into both VMs.

Approach

We cannot use ssh-copy-id because password authentication is switched off for security reasons. That's why we have to copy the public key to VM_b by hand.

Also, the ~/.ssh/authorized_keys file gets reset regularly on all machines for all Research Cloud users. So we have to create an extra user on VM_b that is not affected by this.

Steps

On VM_a

Create a ssh key-pair with

ssh_keygen

(when prompted for something just hit ENTER: no special name, format or passphrase)

Now VM_a has its own key-pair. Totally independent of the key-pair on you local machine.

Output the public key with

cat ~/.ssh/id_rsa.pub

Copy this public key into your clipboard

On VM_b

Create a user for data transfer

sudo useradd -m data-transfer-user

(the -m option also creates a homedir for this user)

sudo passwd data-transfer-user

Add the public key of VM_a for this user

sudo nano /home/data-transfer-user/.ssh/authorized_keys

From your clipboard, copy the public key of VM_a into the opened file "authorized_keys".

nano usage:

(ctrl+O for save, ENTER for confirm, ctrl+X to quit)

If you want to prepare particular folders in the data-transfer user's home, become that user, create the folders and go back to your regular user, again:

su data-transfer-user

mkdir ~/my-data-there

exit

On VM_a

You can test the ssh connection with

ssh data-transfer-user@VM_b

and end the test with

exit

Transfer your data

scp ~/my-data-here/* data-transfer-user@VM_b:~/my-data-there


Now the data should have been copied to vm_b.