Kubuntu ssh-key Management

Problem

I recently switched from Linux Mint to Kubuntu 21.04 and found that KDE Plasma 5 does not automatically add ssh keys to a keyring meaning that each time you want to ssh you need to enter a passphrase.

Solution

Use ksshaskpass package that’s already installed on Kubuntu 21.04.

  • Create a bash script and save it in the following location so that it’s executed on login.
imela@whiscardz:~$ vim ~/.config/autostart-scripts/ssh-add.sh
#!/bin/bash
ssh-add </dev/null
  • This assumes your keys are stored in the default key location ~/.ssh/id_rsa
  • Make the script executable:
imela@whiscardz:~$ chmod +x ~/.config/autostart-scripts/ssh-add.sh
  • Either logout and login or run the script manually and you will be prompted for your ssh passphrase.
imela@whiscardz:~$ bash ~/.config/autostart-scripts/ssh-add.sh

References

Storing SSH Key Passphrases on KDE Plasma