Reply to topic

ssh-agent not started in Wayland

Nayar
Registered Member
Posts
36
Karma
0
OS

ssh-agent not started in Wayland

Fri Aug 31, 2018 4:54 pm
The terminals in dolphin and Konsole do have the ssh-agent present on boot. I have to manually do these:

eval `ssh-agent`
ssh-add ~/.ssh/id_....

I think this is related: https://bugzilla.redhat.com/show_bug.cgi?id=1188282


User avatar jbouter
Registered Member
Posts
15
Karma
0
OS
Bit late to the party, but I found this post on my search to resolve this exact same issue; and I did. This works for both Xorg and Wayland sessions

Kwallet
  • Launch "KDE Wallet Configuration" (press Alt-F2 or whichever shortcun runs KRunner in your setup) type wallet and pick the configuration tool from the list
  • Make sure Enable the KDE wallet subsystem is checked
  • Launch Wallet Manager and create a new wallet if you need to, setting the passphrase. This is the one you need to remember and type every time you login to KDE

Scripts
Create the following scripts:

~/.config/autostart-scripts/ssh-add.sh

Code: Select all
#!/bin/bash
sleep 10
SSH_ASKPASS=/usr/bin/ksshaskpass
export SSH_ASKPASS
ssh-add ~/.ssh/id_ed25519


~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh

Code: Select all
#!/bin/sh
[ -z "$SSH_AGENT_PID" ] || eval "$(ssh-agent -k)"


~/.config/plasma-workspace/env/ssh-agent-startup.sh

Code: Select all
#!/bin/sh
[ -n "$SSH_AGENT_PID" ] || eval "$(ssh-agent -s)"
SSH_ASKPASS=/usr/bin/ksshaskpass
export SSH_ASKPASS


And mark those files as executable:
Code: Select all
chmod +x ~/.config/autostart-scripts/ssh-add.sh
chmod +x ~/.config/plasma-workspace/shutdown/ssh-agent-shutdown.sh
chmod +x ~/.config/plasma-workspace/env/ssh-agent-startup.sh


Next up, export ksshaskpass globally in
/etc/profile.d/ksshaskpass.sh

Code: Select all
#!/bin/bash
export SSH_ASKPASS=/usr/bin/ksshaskpass


And mark executable:
Code: Select all
chmod +x /etc/profile.d/ksshaskpass.sh


Start at login
  • Launch the "Autostart" KDE Control Module (Alt-F2, Autostart)
  • Add a new Script File linking to where you saved the first script (~/.config/autostart-scripts/ssh-add.sh)
User avatar ub1x
Registered Member
Posts
2
Karma
0
Thanks for this info :)

So I'm happy to improve my work with some "konsole" using "ssh -i ~/.ssh/server_id_rsa [email protected]")".

I've added your scripts, but it don't work :(

First issue I find, that "/usr/bin/ksshaskpass" isn't exists on my system (openSUSE Tumbleweed - Kernel 5.10.4-1 / KDE-Plasma 5.20.5 / Qt 5.15.2). According "rpm -qil ksshaskpass5" new place will be "/usr/libexec/ssh/ksshaskpass".

But still if I execute:
Code: Select all
~/.config/plasma-workspace/env/ssh-agent-startup.sh
~/.config/autostart-scripts/ssh-add.sh

"ssh-add" asks on the terminal about the key.

Update:
After reboot it works - thanks for your proposal :)
User avatar jbouter
Registered Member
Posts
15
Karma
0
OS
Glad you got it to work! I should have added the quickest way to get it all working is a reboot, aye.

I've written it based on KDE Neon (Ubuntu), paths will most likely differ on other distributions. But that's nothing a search with your own package manager can't solve :-)

 
Reply to topic

Bookmarks



Who is online

Registered users: Baidu [Spider], bauerwolfgang, Bing [Bot], genishi, Google [Bot], JesusM, koffeinfriedhof, Mace68, Sogou [Bot]