Using the KDE Wallet to store ssh keys with passphrases

I have read an article about SSH passphrases (github:help), but they only explain how to use ssh-agent with msysgit and Mac OSX, no word about Linux.

This guide is about how to use KDE Wallet with ssh-agent. This way, we can use SSH keys with passphrases, but we don't need to enter a passphrase every time we use the key, KDE Wallet does the job. I assume you are using KDE.

In 3 easy steps:

1. Install ksshaskpass

Use your favorite package manager.

2. Create script file

Create the file


On some distributions ~/.kde4/Autostart/

And add this content

export SSH_ASKPASS=/usr/bin/ksshaskpass
ssh-add < /dev/null

3. Make it executable

chmod +x ~/.kde/Autostart/

And run the script (or restart the session)


For security reasons, is a good idea stop ssh-agent when you finish your session, create the file


With this content

ssh-agent -k

This file should be executable

A good page for more info about SSH: Secure Shell (Arch Linux)

comments powered by Disqus