I use 2 SSH keys, one is for git and other one is for my VPS. To use the keys conveniently i run ssh-agent, add the keys with ssh-add then ssh/push to remote. GNOME had an feature that showed me a modal where i add keys to ssh-agent (this modal pops up when i want to ssh/push). I think ssh-agent service is started automatically by GNOME.
Plasma starts the ssh-agent, but does not load keys automatically (atleast on Fedora).
What I do is add a start-up task that runs a script to add my keys.
This is my script that loads 2 keys.
% more ~/bin/kde-startup-tasks
#!/bin/bash
exec >>~/tmpdir/kde-startup-tasks.log 2>&1
echo $(date '+%Y-%m-%d %H:%M:%S') kde-startup-tasks start
# always have the SSH keys loaded
ssh-add -L
ssh-add ~/.ssh/id_ed25519 </dev/null
if [ -e ~/.ssh/id_github_ed25519 ]
then
ssh-add ~/.ssh/id_github_ed25519 </dev/null
fi
echo $(date '+%Y-%m-%d %H:%M:%S') kde-startup-tasks done
I have set export SSH_ASKPASS=/usr/bin/ksshaskpass so that I get a GUI prompt for password for the keys on the 1st login. After that the password is stored in the kwallet.
Note that ssh-add </dev/null this forces the prompt for password via ksshaskpass.
I log its actions in case of bugs.
Just installing ksshaskpass (it was preinstalled in Fedora) and configuring ~/.config/environment.d did the trick! When i first tried to SSH remote machine it asked SSH key pass and also an option to save it into KDE Wallet so i don’t have to type passwords for each restart.