Bug 282417 - konsole should pop-up a dialog to request for an ssh-key password and offer to save it in kwallet
Summary: konsole should pop-up a dialog to request for an ssh-key password and offer t...
Status: RESOLVED DUPLICATE of bug 81067
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: 2.7.1
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-20 16:04 UTC by Craig Magina
Modified: 2011-09-21 14:56 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Magina 2011-09-20 16:04:39 UTC
Version:           2.7.1 (using KDE 4.7.1) 
OS:                Linux

Konsole lacks kwallet integration for ssh-key passwords. Gnome-terminal actually has this integration and it is useful as you don't have to re-enter a key's password for every connection.

Reproducible: Always

Steps to Reproduce:
Launch konsole
Use ssh to connect to a server where the key is passworded

Actual Results:  
Uses the terminal password interface and does not remember the password requiring it to be re-entered every time.

Expected Results:  
Pop's up a dialog asking the user for the ssh-key password. The dialog would have kwallet integration as well.
Comment 1 Jekyll Wu 2011-09-20 19:05:39 UTC
You may want to try ksshaskpass[1], and take a look at bug #81067

[1] http://kde-apps.org/content/show.php/show.php?content=50971
Comment 2 Craig Magina 2011-09-20 20:30:54 UTC
I was curious as to how gnome-terminal handles this and it appears ssh-askpass-gnome is built from openssh. A gnome environment does not use the SSH_ASKPASS environment variable as it seems to be tightly integrated into the openssh bits.
Comment 3 Jekyll Wu 2011-09-20 21:28:14 UTC
I am not familiar with how gnome works, but I think that integration is provided by gnome-keyring, not by gnome-terminal itself.

Here is what I find when running gnome3 :

$ env | grep SSH_AUTH_SOCK
SSH_AUTH_SOCK=/tmp/keyring-FL0ewA/ssh

That is interesting, because normally SSH_AUTH_SOCK is set as "/tmp/ssh-xxxx/agent.<pid>" which is owned by ssh-agent.

`# fuser /tmp/keyring-FL0ewA/ssh` tells me that file is own by a process running as `/usr/bin/gnome-keyring-daemon --start --components=ssh`

So it seems that gnome-keyring-daemon is doing the job of ssh-agent.
Comment 4 Craig Magina 2011-09-20 21:50:55 UTC
You are right on the mark with that.  An excerpt from the gnome-keyring sources.

 SSH and GPG agents
 ------------------
The GNOME keyring includes the functionality of the SSH and GPG agents, 
and it can break some setups, especially if ssh-agent and/or gpg-agent 
is started by hand.
Comment 5 Craig Magina 2011-09-20 22:04:42 UTC
It appears the way they get their integration is via gnome-keyring's ssh and gpg agents and the ssh-askpass-gnome binary that is included with openssh's contrib.
Comment 6 Craig Magina 2011-09-20 22:12:39 UTC
I have ksshaskpass installed and the SSH_ASKPASS environment variable is set properly, however I only see the dialog if I run 'ssh <hostname>' from krunner. If I type the same thing inside of a konsole or if I have a konsole profile set to execute the same command I do not get the pop-up, just the in-terminal password prompt. Is this due to the statement that ssh-add will only call ssh-askpass if ssh has been called from outside of a terminal?
Comment 7 Jekyll Wu 2011-09-20 23:29:29 UTC
(In reply to comment #6)
> 

(In reply to comment #6)
> 

Yes, ssh-add always ignores SSH_AHSPASS and reads passphrase from stdin if stdin is a tty.

Currently I run ksshaskpass automatically right after login into KDE, and it prompts a dialog for opening kwallet. Here is an simple script ~/.kde4/Autostart/ksshaskpass

#!/bin/sh

if which ksshaskpass &> /dev/null ; then
    #SSH_ASKPASS=$(which ksshaskpass) ssh-add < /dev/null
fi

This is not as ideal as the on-demand way in gnome. But it is better than none.

Anyway, such integration is out of the scope of konsole and should be provided by other component of KDE,  as in gnome. Just my 2 cents.
Comment 8 Jekyll Wu 2011-09-20 23:33:16 UTC
(In reply to comment #7)
> 

A leading '#' was added by accident. It should be :

if which ksshaskpass &> /dev/null ; then
    SSH_ASKPASS=$(which ksshaskpass) ssh-add < /dev/null
fi
Comment 9 Jekyll Wu 2011-09-21 14:38:30 UTC

*** This bug has been marked as a duplicate of bug 81067 ***
Comment 10 Craig Magina 2011-09-21 14:56:07 UTC
I would agree that this is outside the scope of konsole. Thanks for all of your input.