Logo

dev-resources.site

for different kinds of informations.

KDE Plasma & ssh keys

Published at
10/2/2020
Categories
kde
plasma
sshagent
wallet
Author
manekenpix
Categories
4 categories in total
kde
open
plasma
open
sshagent
open
wallet
open
Author
10 person written this
manekenpix
open
KDE Plasma & ssh keys

If you're a Linux user, and the desktop environment of your choice is Gnome, you're probably used to letting Gnome Keyring SSH Agent handle your ssh keys. You just log in, your ssh keys stored in your ~/.ssh folder get loaded in memory, and then you can use them not only in terminals but with any process that requires ssh authentication.

Unfortunately, KDE Plasma doesn't have that feature out of the box, so it needs a bit of tweaking to get the same behaviour.

Let's make some changes to Kwallet and add some scripts to start our ssh-agent and load our keys:

Kwallet

Launch KDE Wallet Configuration and make sure the KDE wallet subsystem is enabled.


Launch Kwallet Manager and create a new wallet if necessary and set a passphrase for it.

Scripts

Now we need to create some scripts to start the ssh-agent on startup and add all the keys. For this, it's necessary to have the package ksshaskpass installed.

KDE has a designated folder for scripts that will be executed at login but before launching Plasma.

Folder: ~/.config/plasma-workspace/env

In this folder, we need to create a script to start the ssh-agent. Let's call it ssh-agent-startup.sh.

#!/bin/bash

[ -z "$SSH_AGENT_PID" ] || eval "$(ssh-agent -s)"

Enter fullscreen mode Exit fullscreen mode

Also, KDE uses another folder for scripts at login.

Folder: ~/.config/autostart-scripts

Let's add a script to load all our ssh keys. We'll call our script ssh-add.sh.

#!/bin/bash

export SSH_ASKPASS=/usr/bin/ksshaskpass

ssh-add $HOME/.ssh/my_ssh_key1 $HOME/.ssh/my_ssh_key2 $HOME/.ssh/my_ssh_key3...

Enter fullscreen mode Exit fullscreen mode

Don't forget to mark the scripts as executables:

chmod u+x file/to/mark/as/executable

Enter fullscreen mode Exit fullscreen mode

And that's it. After rebooting, the system will prompt you to enter your keys' passphrases, and if everything went well, you should be able to use your keys with any process that needs ssh authentication.

kde Article's
30 articles in total
Favicon
(Quick-note) Troubleshooting Dual Monitor Issues on KDE on Ubuntu/ Linux Mint
Favicon
bash: No such file or directory
Favicon
How To Unhide Titlebars on Maximised Windows in KDE Plasma 6
Favicon
DinaWall 0.2
Favicon
How to enable auto dark mode (night theme) in KDE Plasma
Favicon
Using KConfig with Rust
Favicon
Bitflags in Rust
Favicon
Season of KDE 2022
Favicon
Creating Rust/QML Project using Templates
Favicon
My sleek and modern Linux development machine in 2021
Favicon
Activate USB Wi-Fi Receiver from Terminal
Favicon
KDE Development with Podman
Favicon
My KDE Workfloaw
Favicon
How to recover KDE if it doesn't load after updating FreeBSD from 12.x to 13.0-RELEASE
Favicon
Fuck FreeBSD
Favicon
The state of Linux as a daily use OS in 2021
Favicon
SPOTIFY SYSTEM TRAY [KDE]
Favicon
Fedora - KDE development journey (Qt5X11Extras)
Favicon
Fedora - KDE development journey (Qt5UiPlugin)
Favicon
Fedora - KDE development journey (Qt5Qml / qmake)
Favicon
KDE vs GNOME
Favicon
Setting up Arch Linux with KDE Plasma in Windows Subsystem for Linux 2
Favicon
âš™ My Arch Linux setup
Favicon
Writing a KDE Plasmoid to display JioFi Stats
Favicon
KDE Plasma & ssh keys
Favicon
Trying out KDE
Favicon
My (k)Ubuntu (OSX look alike) desktop setup
Favicon
KDE Neon on 2017 MacBook Air
Favicon
Script your Yakuake with default tabs
Favicon
How to execute Firefox with support for KDE filepicker

Featured ones: