Bug 44177 - ssh-agent startup support missing
Summary: ssh-agent startup support missing
Status: RESOLVED UNMAINTAINED
Alias: None
Product: kdm
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR wishlist
Target Milestone: ---
Assignee: kdm bugs tracker
URL:
Keywords:
: 53051 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-06-20 22:48 UTC by dan
Modified: 2018-04-16 20:27 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
ssh-askpass program that integrates KWallet (3.85 KB, text/plain)
2004-12-26 19:02 UTC, Esben Mose Hansen
Details
A desktop file for Automatic registering of ssh keys (294 bytes, text/plain)
2004-12-26 19:03 UTC, Esben Mose Hansen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dan 2002-06-20 22:41:51 UTC
(*** This bug was imported into bugs.kde.org ***)

Package:           kdm
Version:           KDE 3.0.0 
Severity:          wishlist
Installed from:    RedHat RPMs
Compiler:          gcc
OS:                Linux
OS/Compiler notes: RedHat 7.3

There is no way within KDE for a user to
have his session run with (or probably
actually within) an instance of ssh-agent.

ssh-agent is required for such things as
:ext: ssh access with cervisia (a kde 
application).

Searching google for this it appears that the common way is to hack the 
system wide script that executes startkde
on behalf of the user.  This appears to 
be completely undocumented on kde.org.
The standard methods recommended in
ssh documents and books don't work 
because KDE doesn't use .xsession.

There should be some way for a user to
specify that she wants her session to
run under/with ssh-agent.


(Submitted via bugs.kde.org)
Comment 1 Oswald Buddenhagen 2003-02-08 13:00:07 UTC
*** Bug 53051 has been marked as a duplicate of this bug. ***
Comment 2 Paolo Sacconier 2004-03-15 12:45:13 UTC
People using key-chian need this feature a lot,  gdm seems to support already ssh-agents and ssh-askpass at startup, looking at that code may be a good idea.
Comment 3 Marcin Kasperski 2004-04-06 14:50:08 UTC
At least on Debian ssh-agent is just run even before KDE (or any other X11 session).  It is done by just running xsession as the command  
  /usr/bin/ssh-agent /usr/bin/x-session-manager

The exact details how to reproduce depend on the distribution. In debian there is nice Xsession.d convention:
- /etc/X11/Xsession delegates most processing to /etc/X11/Xsession.d/* subscripts
- one of the first of those scripts sets STARTUP shell variable to the correctly detected session manager
- the entry for ssh-agent resets STARTUP variable to "/usr/bin/ssh-agent $STARTUP"
- last of those scripts runs X session using $STARTUP
Comment 4 Marcin Kasperski 2004-04-06 14:54:32 UTC
By the way: there is second program which require similar to ssh-agent integration - gpg-agent used by kmail S/MIME and GPG handlers. Its integration is even a bit harder as it doesn't handle parent-process way of merging with X and requires trick like running from Xsession
   eval `gpg-agent --daemon`

  
Comment 5 Marcin Kasperski 2004-04-06 14:58:26 UTC
Summarizing my remarks: it seems to me that the best way to run ssh-agent and gpg-agent is to spawn them before KDE, from Xsession. Nevertheless, KDE could provide some docs&examples of how to do it and even more importantly, the applications which require usage of one of those agents could display detailed help when they are run and detect that the agent are not present.

There is also a problem when some machine user needs this feature and he or she is not able to reconfigure global Xsession and even not able to configure his own Xsession (the case when root don't want those agents and don't allow for user Xsessions). In this case KDE could probably help somehow.
Comment 6 kris 2004-04-06 15:13:26 UTC
Running ssh-agent/gpg-agent is better than running no agent at all (and for example Suse distributes a standard setup that already does this).

Still, even if these two agents are already running they still know nothing about he KDE wallet infrastructure and so I have to type my password to login, type my password to unlock the wallet, type my password to load ssh-agent and type my password to load gpg-agent. This is a nonsolution.

I want to type my password to login and be done with it. Everything else, kwallet, ssh-agent and gpg-agent must be able to use this single authentication, no additional password required.
Comment 7 Marcin Kasperski 2004-04-06 15:32:22 UTC
Hmm, it is ssh-add what asks for passphrase, not ssh-agent. It seems to me that one could run ssh-agent as described above and it is ssh-add (or maybe some custom kde clone of ssh-add) what requires kwallet integration.
Comment 8 Marcin Kasperski 2004-04-06 15:34:13 UTC
BTW: I second the voice that kwallet should not require additional password to be opened. Or at least it should give such an option for the less paranoid. Of course the password check should happen (so su - user don't give kwallet access) - just the kdm login routine could open kwallet simultaneously with logging in and using the same password.
Comment 9 Oswald Buddenhagen 2004-04-06 15:35:37 UTC
hmm, the single-sign-on boils down to something like bug #35396
Comment 10 Esben Mose Hansen 2004-12-26 19:02:01 UTC
Created attachment 8819 [details]
ssh-askpass program that integrates KWallet

If ssh-agent is started (using keychain or whatever), it is fairly trivial to
integrate ssh-add with KWallet. I wrote a solution that some of you might want
to help me test out?

Just compile the attached program (requires the devel versions of KDE and QT,
of course) with something like

g++ -O2 -I/usr/kde/3.3/include -I/usr/qt/3/include -L /usr/qt/3/lib
-L/usr/kde/3.3/lib -lqt-mt -l kdecore -lkwalletclient kde-ssh-askpass.cpp
-lkdeui -o kde-ssh-askpass

Become root, and install it in the appropriate directory. It's printed when
openssh is configured, and it is the same place as sftp-server, ssh-keysign and
friends are install. For me (Gentoo) it's /usr/lib/misc:
install kde-ssh-askpass /usr/lib/misc/ssh-askpass.

Then test it by doing somethinglike
echo "no tty for you" | ssh-add
(The trick is that ssh-add only uses ssh-askpass if it has no terminal
attached)
This should pop up a few dialogs: Allow KWallet open, allow ssh-askpass to
access the local password folder, and finally the keyphrase. Only the first one
should be need to be redone, and only once per KDE session, depending on
configuration.

Next, install the soon-to-be-attached desktop file in ~/.kde/Autostart, and
restart KDE (or start a new session). Test it by opening a console and do

ssh-add -l

Your keys should be listed. 

Please tell me how it went (or catch me on Jabber at mesbenh@jabber.dk)
Comment 11 Esben Mose Hansen 2004-12-26 19:03:01 UTC
Created attachment 8820 [details]
A desktop file for Automatic registering of ssh keys
Comment 12 Marcin Kasperski 2004-12-27 11:09:17 UTC
*** This bug has been confirmed by popular vote. ***
Comment 13 Mathieu Jobin 2005-05-20 09:31:20 UTC
I would like kdm to replace gtk2-ssh-askpass
I use it along with the package called keychain under gentoo, it holds my ssh key just fine.

I just think it silly to type twice the same passwd. kdm could feed the same process that gtk2-ssh-askpass go through.

just my two cents.

thanks.

also, instead of a no-passwd kwallet, kdm could also TRY to open the kwallet on_login. if the pass is different, the process should not be different than right now.

second password dialog for ssh-key, third one for kwallet. if passwd is same, well, dont need to ask 8 times.

thank you.

Comment 14 Cyrill Helg 2008-06-05 11:39:41 UTC
I have this problem in kde4 as well when gtk2-ssh-askpass is installed. It's really annoying as it pop ups all the time when I use konqueror do get an sftp connection for example.
Comment 15 Esben Mose Hansen 2008-06-06 09:41:33 UTC
It seems to me there is two issues here. 

1. kdm and kdewallet should be integrated so that a user can unlock his wallet with his login pass without having to typing it twice.
2. ssh-askpass needs a kwallet-aware cousin, that will get the passwords for the keys (and should probably install all keys that it has passwords for) from kwallet.

Together, these should solve the problem for all KDE applications. Then there is the issue about gtk2-ask-pass, which probably calls for a political solution. Freedesktop.org might be the way to go with that. I imagine some kind of protocol by which an application can achieve access to to a wallet-style feature on the users desktop, irrespective of the flavour of said desktop.
Comment 16 Nate Graham 2018-04-16 20:27:07 UTC
KDM is unmaintained and not used in KDE Plasma 5.

SDDM is the login manager used in KDE Plasma 5. If you still have this same issue with SDDM, please file an issue on the SDDM bugtracker (after doing a search for existing issues first!): https://github.com/sddm/sddm/issues/
Comment 17 Nate Graham 2018-04-16 20:27:40 UTC
KDM is unmaintained and not used in KDE Plasma 5.

SDDM is the login manager used in KDE Plasma 5. If you still have this same issue with SDDM, please file an issue on the SDDM bugtracker (after doing a search for existing issues first!): https://github.com/sddm/sddm/issues/