SSH keys
Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More β†’

  1. Create an SSH key pair with the following command:

    ​​​​ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519_key -C "MyNewKey"
    
  2. Add your newly generated Ed25519 key to an SSH agent:

    ​​​​ssh-add ~/.ssh/id_ed25519_key
    
  3. Copy the public key to Rackham or other server.

    ​​​​ssh-copy-id -i .ssh/id_ed25519_key.pub rackham.uppmax.uu.se
    
  4. Connect

    ​​​​ssh username@rackham.uppmax.uu.se
    

On Bianca

  • Add the content of your public key id_ed25519_key.pub to $HOME/.ssh/authorized_keys. You can not use the same command ssh-copy as in the case for Rackham i.e. you have to manually bring the key on Bianca.
    If you paste it, make sure it is in one line, not wrapped/split over multiple lines.
  • Make sure the permissions look something like this.
    ​​$ chmod 0700 ~/.ssh
    ​​$ ls -ld ~/.ssh
    ​​drwx--S--- 2 user user 4096 May  7  2019 .ssh
    ​​
    ​​
    ​​$ chmod 600 ~/ss/authorized_keys
    ​​$ ls -l ~/.ssh
    ​​total 1
    ​​-rw------- 1 user user 743 May  7  2019 authorized_keys
    
  • Connect to Bianca (it is critical to use SSH agent in this case, see above)
    ​​ssh -A username@bianca.uppmax.uu.se
    
  • To debug, run with -vv
    ​​...
    ​​debug1: Requesting authentication agent forwarding.
    ​​debug2: channel 1: request auth-agent-req@openssh.com confirm 0
    ​​...
    ​​
    ​​debug1: client_input_channel_open: ctype auth-agent@openssh.com rchan 2 win 65536 max 16384
    ​​debug1: client_request_agent: bound agent to hostkey
    ​​debug2: fd 8 setting O_NONBLOCK
    ​​debug1: channel 2: new [authentication agent connection]
    ​​debug1: confirm auth-agent@openssh.com
    ​​Last login: Tue Jul 11 18:44:21 2023 from 172.18.144.254
    ​​ _   _ ____  ____  __  __    _    __  __
    ​​| | | |  _ \|  _ \|  \/  |  / \   \ \/ /   | System:    sens2017625-bianca
    ​​| | | | |_) | |_) | |\/| | / _ \   \  /    | User:      user
    ​​| |_| |  __/|  __/| |  | |/ ___ \  /  \    | 
    ​​ \___/|_|   |_|   |_|  |_/_/   \_\/_/\_\   | 
    
    ​​  ###############################################################################
    

Look for the important line…

debug1: channel 2: new [authentication agent connection]

WSL2 under Windows{10,11}

Here as a neat way to get persistent key-manger in WSL2 - credits: original source.

sudo apt-get install keychain

Replace XXXX with the output of hostname command on the command line.

/usr/bin/keychain -q --nogui $HOME/.ssh/id_ed25519_key
source $HOME/.keychain/XXXX-sh

Remove -q to get some information if you want

 * keychain 2.8.5 ~ http://www.funtoo.org
 * Found existing ssh-agent: 4487
 * Known ssh key: /home/user/.ssh/id_ed25519_key

First time you login, you will be asked for the password and the key wil be handled by the key-manager. Check with

$ ssh-add -L
ssh-ed25519 AAAAC3Nz...  ...cTTtiU MyNewKey

MobaXterm

In MobaXterm you can use the internal MobAgent or/and the Peagent from the PuTTy tools.

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More β†’

OPTIONAL: SSH config

Example $HOME/.ssh/config file to make your work easier.

Host rackham
  User username
  HostName rackham.uppmax.uu.se
  ServerAliveInterval 240
  ServerAliveCountMax 2

# Default settings
#=======================================
Host *
  ForwardAgent no 
  ForwardX11 yes
  ForwardX11Trusted yes
  ServerAliveInterval 120
#=======================================

Now

# without config
ssh -Y username@rackham.uppmax.uu.se
# with config
ssh rackham
# without config
scp local_file username@rackham.uppmax.uu.se:remote_folder/
# with config
scp local_file rackham:remote_folder/

rsync ...
sftp ...

Contacts:

tags: UPPMAX, ssh-key