Auto unlock ssh keys on Debian 13 with KDE


Note that this works on an up-to-date Debian Sid (aka Debian “unstable”) distribution, running the kde-full metapackage. Adapt accordingly based on your distribution’s conventions.

Start by creating a new script ~/.config/autostart-scripts/ssh-unlock.sh with the following:

#!/bin/bash
SSH_ASKPASS=/usr/bin/ksshaskpass ssh-add $HOME/.ssh/YOUR-KEY-1 $HOME/.ssh/YOUR-KEY-2 </dev/null

Replace YOUR-KEY with the path to your keys. Then make that script executable:

chmod +x ~/.config/autostart-scripts/ssh-unlock.sh

Done! When you log back in, you will be asked to provide the password for each of your keys. Make sure you tick the box to store the contents in the KDE wallet.

Previous Next