SSH Key Management on KDE

Martin Airs martin at airs.me.uk
Wed Jul 9 12:49:13 UTC 2014


On Tuesday 08 July 2014 14:07:35 Sudhir Khanger wrote:
> Hello,
> 
> I am wondering how you guys manage multiple ssh keys on your system.
> 
> This is how I got to manage multiple keys on my system.
> 
> Generate keys
> ssh-keygen -t rsa -f ~/.ssh/test_ssh_key_1 -C "yours at yours.com"
> ssh-keygen -t rsa -f ~/.ssh/test_ssh_key_2 -C "yours at yours.com"
> ssh-keygen -t rsa -f ~/.ssh/test_ssh_key_3 -C "yours at yours.com"
> 
> ksshaskpass came already installed and SSH_ASKPASS set to
> /usr/bin/ksshaskpass.
> 
> Moving on these keys can be added to ssh-agent using following command.
> 
> ssh-add ~/.ssh/test_ssh_key_1
> 
> I ran these commands through KRunner so it triggers ksshaskpass and
> not password prompt on the terminal. This way Kwallet will save the
> password and I will not be asked to enter passphrase every time I am
> accessing anything over ssh.
> 
> In order to automatically load these keys at system start I created
> following script.
> 
> ~/.kde/Autostart/ksshaskpass
> 
> #!/bin/sh
> export SSH_ASKPASS=/usr/bin/ksshaskpass
> ssh-add ~/.ssh/test_ssh_key_1 < /dev/null
> ssh-add ~/.ssh/test_ssh_key_2 < /dev/null
> ssh-add ~/.ssh/test_ssh_key_3 < /dev/null
> 
> chmod 755 ~/.kde/Autostart/ksshaskpass
> 
> The problem is if KWallet is not opened as soon as system is started
> KDE will start the script triggering ksshaskpass to ask to enter
> password for the first ssh key. This is a working setup but not
> perfect.
> 
> I was wondering if there is a way to ssh-add the key to ssh-agent
> on-demand or maybe trigger to open KWallet instead of ksshaskpass.
> 
> What is wrong with my setup? How do you manage your ssh keys?

Thats exactly how I do it too, love to know of other ways

Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.fedoraproject.org/pipermail/kde/attachments/20140709/a5d2e1d0/attachment.sig>


More information about the kde mailing list