Moving files to and from the cluster using ssh keys


The adoption of the ssh keys as a consequence of the increased security requirements have some effect also on the way files are transferred to and from the cluster. We cover here the most common method users use, as far as we know, for file transfer:

Using scp

Just ad the option -i path-to-private-ssh-key to your command:

For example, to copy the file file1.txt from the local machine to the root of your home directory on the cluster, use the command, on your local machine:

scp -i ~/.ssh/gbar file1.txt s123456@transfer.gbar.dtu.dk:

And to copy back the file from the cluster to your local machine

scp -i ~/.ssh/gbar s123456@transfer.gbar.dtu.dk: .

NOTE: Change s123456 to your actual DTU credential, of course.

You will be required first to enter the passphrase for your ssh-key, and the prompted for the DTU password.

Using Filezilla

Filezilla can be setup to use ssh keys, but its support is quite primitive. Basically, one can only decide to set the usage of a private ssh-key globally, not only for a specific host.

  • To do so, start Filezilla, and go to Settings, select SFTP and select “Add key file…”

Filezilla add ssh-key settings

  • Got to the directory where you have the private key file, and select it.

NOTE: if you have created the file under a unix system, Filezilla will complain and ask you to convert it into a supported format. Select Yes and Filezilla will create a converted key in the .ppk (PuTTY Private Key Files format). You will be asked to enter the passphrase you used to generate the key, and then select a name and a directory where to save it.

  • Then, when you want to use Filezilla, start it a usual, and select transfer.gbar.dtu.dk as Host, write your username and DTU password. Then, during the connection phase, you will be asked for the passphrase.

NOTE: if you want to setup a Site entry in the Site Manager, Leave “Logon type:” to the default “Ask for password

Using Cyberduck

Setting up Cyberduck to use ssh keys is simple.

Just select “Open Connection”, select “SFTP (SSH File Transfer Protocol)”, use transfer.gbar.dtu.dk as server, put your username and DTU password, and i the “SSH Private Key” field select the ssh private key file

It will prompt you for the passphrase for the ssh private key (only necessary outside the DTU network).

That’s all.

Using Winscp

Winscp can be easily configured to use ssh keys. Have a look at the official winscp documentation here