Secure GitHub credentials with KWallet

Konsole + GitHub + KWallet

Hi and welcome to my blog!

KWallet is a KDE Plasma tool to store any credentials and secrets safely. It has an interface called KWallet Manager that allows one to manage credentials and secrets easily.

In this quick tutorial, I’ll show how to configure your KDE to store your GitHub credentials in KWallet. This guide was tested against openSUSE Tumbleweed but should work for most Linux distributions.

First, make sure to have ksshaskpass installed. ksshaskpass is an ssh-add helper that uses kwallet and kpassworddialog to show a window where you should type your credentials.

Now, create an autostart script file and mark it as executable:

vim ~/.config/plasma-workspace/env/

Put the following content in the file:

export GIT_ASKPASS='/usr/lib/ssh/ksshaskpass'

Save and exit. Now make it executable.

chmod +x ~/.config/plasma-workspace/env/

Next time you log in, open Konsole and try to clone some of your private GitHub repositories. If your wallet is already open and you will see the ksshaskpass dialogue asking for your username and then asking for your password. Ensure to mark “Remember password” to save your credentials safely in your wallet.


Related Content