You are not logged in.
Hi all,
Since its upgrade yesterday, kde-agent does not support ssh-agent anymore (see here). I consequently can't store unlocked SSH keys anymore, because ssh-add from a konsole can't connect to ssh-agent.
The update note above mentions that the SSH agent is not needed by KDE since years. What's the recommended way to start it now ?
Thanks a lot !
Aurélien.
Last edited by aurelieng (2014-01-03 08:39:49)
Offline
What's the recommended way to start it now ?
Any of the methods described here:
https://wiki.archlinux.org/index.php/SSH_Keys#ssh-agent
You can also copy the old ssh- scripts into your ~/.kde4/env and ~/.kde4/shutdown folders, check permissions, and make sure they are executable.
Personally, I added eval $(ssh-agent) to my ~/.profile, which is sourced by ~/.zsh_profile.
Offline
Thanks. I added to my ~/.profile too.
Offline
Doesn't this run a separate agent for every shell session you create?
Offline
That's what i was afraid of. Fortunately, it doesn't run a separate agent for each konsole, but it does start a new one automatically if I connect through SSH to a machine I'm already logged in with X, for instance. Quite convenient
Offline
The update note above mentions that the SSH agent is not needed by KDE since years. What's the recommended way to start it now ?
I'd like to know that, too.
Since the update suggests there's another (better) way to manage one's key(s)
I'd like to try that, especially if it's really a better way.
Laptop: Arch Linux (x86_64) and Win10 (x86_64); Intel Core i7-3630QM @ 2.40GHz, 8 GiB RAM, NViDiA GeForce GT 650M w/ 2 GiB
Desktop: Arch Linux (x86_64) and Win10 (x86_64); Intel Core i7-4771 @ 3.50GHz, 32 GiB RAM, AMD Radeon RX 480 w/ 8 GiB
Offline
It looks like the .profile method creates one ssh-agent per X session. But once I log out and log back in, I end up having two ssh-agent.
Is there a way to kill it when I log out? Or maybe there is a new, better method for dealing with ssh-agent (or different way of dealing with passwords for SSH keys in general)?
If there isn't, why was it removed in the first place? The ".profile method" looks more like a hack to get sort-of old behaviour...
Last edited by sjakub (2014-01-08 02:18:02)
Offline
I have been using ssh-agent with KDE on a daily basis for years and AFAIK, there is no better or more convenient way of keeping your private keys available. So in my opinion, the removal of ssh-agent, a tiny daemon that doesn't do any harm yet serves its purpose very well, was a bad idea.
I found a solution that does not run multiple ssh-agent daemons, even if KDE crashes. The solution is based on the fact that ssh-agent can be used as a wrapper around a session startup script or program. Unfortunately, my solution is very intrusive and will disappear on each KDE update. It works as follows:
# cd /usr/bin
# mv startkde startkde-inner
# cat > startkde <<- HERE
#!/bin/sh
exec /usr/bin/ssh-agent /usr/bin/startkde-inner
HERE
# chmod +x startkde
Now the ssh-agent will be started on each KDE session and there will always be only one ssh-agent per KDE session. Comments in the startkde script suggest starting ssh-agent later in the process and then killing it on logout. However, such a solution is inherently unreliable, because it will not kill your ssh-agent when the X-server or KDE crashes. The same problem applies to starting ssh-agent from profile scripts. The wrapper method resolves the issue in a quite reasonable way.
Last edited by andrej.podzimek (2014-01-08 13:27:25)
Offline
@andrej.podzimek: I couldn't agree more. Unfortunately it seems the maintainer of kde-agent does not want to reintroduce the feature, as he closed your bug report a few hours ago :-/
Do you think it would be a good idea to create an AUR package named e.g "kde-agent-ssh" , that would contain the 'ssh-agent-startup.sh' 'ssh-agent-shutdown.sh' scripts ?
Edit: here it is: https://aur.archlinux.org/packages/kde-agent-ssh
Last edited by aurelieng (2014-01-08 16:34:05)
Offline
Unfortunately, my solution is very intrusive and will disappear on each KDE update. It works as follows:
# cd /usr/bin # mv startkde startkde-inner # cat > startkde <<- HERE #!/bin/sh exec /usr/bin/ssh-agent /usr/bin/startkde-inner HERE # chmod +x startkde
Now the ssh-agent will be started on each KDE session and there will always be only one ssh-agent per KDE session. Comments in the startkde script suggest starting ssh-agent later in the process and then killing it on logout. However, such a solution is inherently unreliable, because it will not kill your ssh-agent when the X-server or KDE crashes. The same problem applies to starting ssh-agent from profile scripts. The wrapper method resolves the issue in a quite reasonable way.
If you start KDE from .xinitrc, you can modify the startkde line like so:
exec ssh-agent startkde
This wraps around startkde in a more seamless manner, and so far seems to be working!
Offline
It's not KDE specific, but since the kde-agent-ssh package no longer exists, the systemd solution worked for me.
~/.config/systemd/user/ssh-agent.service
[Unit]
Description=SSH key agent
[Service]
Type=forking
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
ExecStart=/usr/bin/ssh-agent -a $SSH_AUTH_SOCK
[Install]
WantedBy=default.target
Add
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"
to your shell's startup file (and reload it to get the changes). Enable it with
systemctl --user enable ssh-agent
and start with
systemctl --user start ssh-agent
Offline
It's not KDE specific, but since the kde-agent-ssh package no longer exists, the systemd solution worked for me.
....
It works like a charango!!! Thanks!
Offline