Skip to content
Simon Gene Gottlieb edited this page Sep 16, 2022 Β· 13 revisions

SSH

SSH Config File

At the FU-Berlin it is not possible to reach the ComputeServers directly. Instead, you have to log in to one of the log in servers and from there you have to jump to the server you are interested in. This can be simplified by setting up a ~/.ssh/config file. In this case, it is a setup for the redwood server:

Host redwood
    User yourUserNameAtFUBerlin
    HostName redwood.imp.fu-berlin.de
    ProxyJump yourUserNameAtFUBerlin@login.imp.fu-berlin.de

This file says that the name "redwood" is now pointing to "redwood.imp.fu-berlin.de" and to reach this server it has to jump over "login.imp.fu-berlin.de". Also use a certain User name when logging into the server. You can add as many of these "Host" entries to the file as you like.

Creating a key pair

SSH is only fun if you don't have to type in passwords everywhere all the time. If you haven't done it already, you should create an ssh key:

$ ssh-keygen -t rsa -b 4096 -C "mypersonalrsakey"

This will create a ~/.ssh/id_rsa and a ~/.ssh/id_rsa.pub file. Never give the ~/.ssh/id_rsa file away. It is your private key and should never leave your computer. The ~/.ssh/id_rsa.pub is your public key. You can and have to give it to all system that you want to be able to log in to. This can also be used for github.

Installing SSH-Key

To install your public ssh keys on redwood and login simply run:

$ ssh-copy-id redwood

You should be prompted if you trust the servers fingerprint. Afterwards you also get prompted with your user password

SSH into a server

Now you can access the redwood server by running

$ ssh redwood

If you want to copy a file to the server, you can run

$ scp somelocalfile redwood:

Or if you want to copy a file from the server to your local machine run

$ scp redwood:remotefile .

You can also add the "-r" option if you are copying directories.

Clone this wiki locally