Skip to content
Simon Gene Gottlieb edited this page Mar 1, 2024 · 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 e.g.: compute01.fub will be redirected to compute01.imp.fu-berlin.de server:

Host andorra.imp.fu-berlin.de
    User yourUserName

Host *.fub
    User yourUserName
    ProxyCommand ssh -W $(echo %h | cut -d. -f1).imp.fu-berlin.de:%p andorra.imp.fu-berlin.de

This file says that the name "compute01.fub" is now pointing to "compute01.imp.fu-berlin.de" and to reach this server it has to jump over "andorra.imp.fu-berlin.de". Also use a certain Username 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 compute12 and login simply run:

$ ssh-copy-id login

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 compute12

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

$ scp somelocalfile compute12:

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

$ scp compute12:remotefile .

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

Clone this wiki locally