User Tools

Site Tools


tutorial:ssh

Configuring your account

Your Informatik ID gives you LDAP credentials needed to access the network. You can change your password, shell, and home directory from this portal https://webportal.informatik.uni-bonn.de/UserPortal/user_center.shtml

Connecting to a machine

All servers are only available from inside the cs network. Entering the university's internal network can be done using a proxy jump (through the login-servers mentioned later) or using the university's VPN then using ssh to login to the desired machine. In this guide we will be using an example of connecting to the coan-16 machine.

Requirements:

Make sure you have an Informatik ID, and that you install an SSH tool for your operating system and you are able to log in to the university's network you can do so by following this guide https://gsg.bit.uni-bonn.de/doku.php?id=en:ssh. Check if you can login into the remotely available servers: ssh login-staff.informatik.uni-bonn.de as staff and ssh login-stud.informatik.uni-bonn.de as a student.

After logging in to the login-server (or by using vpn) you should be able to access our machines, coan-16 in the following exmple: ssh {YOUR_INFORMATIK_ID}@coan-16.

SSH-Keys

You do not have to enter your password every time if you use ssh-keys. After you generated one following e.g. this guide you can setup password-less logins to the jumphosts made available by the gsg by ssh-copy-id login-staff.cs.uni-bonn.de (as a student use login-stud instead). This is especially useful when using the configfile and jumphosts as described in the next section.

Using config file and jump-hosts: (for Linux and Mac)

A convenient way to access all machines is by using (~/.ssh/config). If you add the lines in the following section to your config file (.ssh/config), you can access coan-16 (in this example) by

#if already inside the network
ssh coan-16 
#explicitly use jumphost
ssh -J login-cs coan-16 
#implicitly use jumphost
ssh coan-16-jump 

Add the following to your config file (.ssh/config):

for university staff

Host login-cs
    User YOUR_INFROMATIK_ID
    HostName login-staff.cs.uni-bonn.de

for students

Host login-cs
    User YOUR_INFROMATIK_ID
    HostName login-stud.cs.uni-bonn.de

for both

Host coan-16
    User YOUR_INFROMATIK_ID
    HostName coan-16.cs.uni-bonn.de

Host coan-16-jump
    User YOUR_INFROMATIK_ID
    HostName coan-16.cs.uni-bonn.de
    ProxyJump login-cs

To copy an ssh-key through the tunnel:

 ssh-copy-id -o ProxyJump=login-cs coan-srv-01

Locally mount remote folders

Assume you want to mount your home folder locally by using sshfs and in ~/coan-home. For the following to work you need to add a jumphost entry for our fileserver coan-srv-01 and an entry for the login-server in your .ssh/config (see above).

Host srv01jump
    User {LDAP_ID}
    HostName coan-srv-01.cs.uni-bonn.de
    ProxyJump login-cs
# make sure sshfs is installed
sudo apt install sshfs
# make sure local folder exists
mkdir ~/coan-home

sshfs {username}@srv01jump:/home/I/{username} ~/coan-home -o follow_symlinks
tutorial/ssh.txt · Last modified: 2021/11/16 17:40 by jonas.charfreitag

Page Tools