KDE Wallet

From ArchWiki
(Redirected from KWallet)
Jump to navigation Jump to search

KDE Wallet Manager is a tool to manage passwords on the KDE Plasma system. By using the KWallet subsystem it not only allows you to keep your own secrets but also to access and manage the passwords of every application that integrates with KWallet.

Unlock KDE Wallet automatically on login

  • kwallet-pam is not compatible with GnuPG keys, the KDE Wallet must use the standard blowfish encryption.
  • The chosen KWallet password must be the same as the current user password.
  • The wallet cannot be unlocked when using autologin.
  • The wallet cannot be unlocked when using a fingerprint reader to login
  • The wallet must be named kdewallet (default name). It does not unlock any other wallet(s).
  • If using KDE, one may want to disable Close when last application stops using it in KDE Wallet settings to prevent the wallet from being closed after each usage (WiFi-passphrase unlock, etc.).
  • It may be needed to remove the default created wallet first, thus removing all stored entries.
  • If the kwallet Migration Assistant asks for a password after every login, rename or delete the ~/.kde4/share/apps/kwallet folder.

Install kwallet-pam for the PAM compatible module.

Optional install kwalletmanager for the wallet management tool. This tool can be used to create a KDE Wallet with blowfish encryption and more settings not provided by the kcm-module.

Tip: An alternative is to use KWalletManager and set an empty Kwallet-password, thus preventing the need of entering a password to unlock a wallet. Simple don't enter a password on both fields in Change Password... This may however lead to unwanted (read/write) access to the user's wallet. Enabling Prompt when an application accesses a wallet under Access Control is highly recommended to prevent unwanted access to the wallet.

Configure display manager

The following lines must be present under their corresponding sections:

auth            optional        pam_kwallet5.so
session         optional        pam_kwallet5.so auto_start

It may be needed to edit the display manager configuration:

  • For SDDM no further edits should be needed because the lines are already present in /etc/pam.d/sddm.
  • For GDM edit /etc/pam.d/gdm-password accordingly.
  • For LightDM edit /etc/pam.d/lightdm and /etc/pam.d/lightdm-greeter files:
auth            include         system-login
auth            optional        pam_kwallet5.so

account         include         system-login

password        include         system-login

session         include         system-login
session         optional        pam_kwallet5.so auto_start

Using the KDE Wallet to store ssh key passphrases

Note: A SSH agent should be up and running.

Install ksshaskpass package.

Create an autostart script file and mark it as executable:

ssh-add -q < /dev/null
Tip: The above ssh-add.sh script will only add the default key ~/.ssh/id_rsa. Assuming you have different SSH keys named key1, key2, key3 in ~/.ssh/, you may add them automatically on login by changing the above script to:
ssh-add -q ~/.ssh/key1 ~/.ssh/key2 ~/.ssh/key3 < /dev/null

You also have to set the SSH_ASKPASS environment variable to ksshaskpass. For example, create the following autostart script file and mark it executable:


export SSH_ASKPASS='/usr/bin/ksshaskpass'

It will ask for your password and unlock your SSH keys. Upon restart your SSH keys should be unlocked once you give your kwallet password.

To add a new key and store the password with kwallet use the following command

$ ssh-add /path/to/new/key </dev/null

and append the key to the list of keys in ~/.config/autostart-scripts/ssh-add.sh as explained above to have it unlocked upon providing the kwallet password.

Using the KDE Wallet to store Git http/https credentials

Git can delegate credentials handling to KDE Wallet using a helper like ksshaskpass

Install the ksshaskpass package.

Configure Git by setting the GIT_ASKPASS environment variable:


export GIT_ASKPASS='/usr/bin/ksshaskpass'

See gitcredentials(7) for alternatives and more details.

KDE Wallet for Chrome and Chromium

Chrome/Chromium has built in wallet integration. To enable it, run Chromium with the --password-store=kwallet or --password-store=detect argument. To make the change persistent, see Chromium/Tips and tricks#Making flags persistent. (Setting CHROMIUM_USER_FLAGS will not work.)

See also