Bug 18452 - The system close connection of terminal in LXQt when setting ssh-askpass
Summary: The system close connection of terminal in LXQt when setting ssh-askpass
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-05-13 09:04 CEST by papoteur
Modified: 2018-03-14 09:06 CET (History)
4 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description papoteur 2016-05-13 09:04:29 CEST
Description of problem:
Qterminal or xterm receive like "exit" command at regular intervals (more than 10 min). If su is connected, it returns to user connection, if user, it close the xterm or QTerminal window.
I have a ssh configuration to access git.mageia.org.

When connected as root, I caught the message :
 attente de données expirée : déconnexion automatique

 Thus : Expiration of data waiting: automatic disconnection
then I'm as user.
I have given the true passphrase at start.
Comment 1 Marja Van Waes 2016-05-13 23:45:04 CEST
What is the output of

  rpm-qa | grep openssh-askpass



There has been an issue, for which I forgot to file a bug report, see 

https://ml.mageia.org/l/arc/dev/2016-03/msg00000.html

that still seems valid.

Please check:

  /etc/profile.d/90ssh-askpass.sh 

if it contains:

  export SSH_ASKPASS=/usr/libexec/openssh/ssh-askpass

then try replacing that line with

  export SSH_ASKPASS=/usr/lib64/ssh/ssh-askpass

(s/64// if needed ;-) )

CC: (none) => marja11
Source RPM: (none) => openssh

Comment 2 papoteur 2016-05-14 16:55:23 CEST
Thanks Marja,
rpm -qa | grep openssh-askpass
openssh-askpass-common-7.2p2-2.mga6
lxqt-openssh-askpass-0.10.0-5.mga6
openssh-askpass-7.2p2-2.mga6

The new export doesn't work. I get directly 
 * Error: Problem adding; giving up
in the console I just opened.
Comment 3 Marja Van Waes 2016-05-14 17:30:57 CEST
(In reply to papoteur from comment #2)
> Thanks Marja,
> rpm -qa | grep openssh-askpass
> openssh-askpass-common-7.2p2-2.mga6
> lxqt-openssh-askpass-0.10.0-5.mga6
> openssh-askpass-7.2p2-2.mga6
> 
> The new export doesn't work. I get directly 
>  * Error: Problem adding; giving up
> in the console I just opened.

Sorry :-(

What you had before must have been better for lxqt-openssh-askpass.

Can you revert it?

Do you get auto-disconnected, too, when connecting to git in a VT?

Assignee: bugsquad => doktor5000
Source RPM: openssh => lxqt-openssh-askpass-0.10.0-5.mga6

Comment 4 papoteur 2016-05-14 17:47:38 CEST
@Marja,
My directory /usr/lib64/ssh is void, thus it is not surprising that the new export doesn't work.
It seems that something has changed since the topic you cited.
However, I don't think that the problem is related. The askpass works when the console is launched.

Assignee: doktor5000 => bugsquad
Source RPM: lxqt-openssh-askpass-0.10.0-5.mga6 => openssh

Marja Van Waes 2016-05-14 19:23:35 CEST

Assignee: bugsquad => guillomovitch

Florian Hubold 2016-05-16 14:19:48 CEST

CC: (none) => doktor5000

Comment 5 Johnny A. Solbu 2016-06-28 09:55:38 CEST
(In reply to Marja van Waes from comment #1)
> What is the output of
> 
>   rpm-qa | grep openssh-askpass

rpm -qa | grep openssh-askpass
openssh-askpass-common-7.2p2-1.mga6
openssh-askpass-qt4-1.0.1-9.mga6

>   /etc/profile.d/90ssh-askpass.sh 
> 
> if it contains:
> 
>   export SSH_ASKPASS=/usr/libexec/openssh/ssh-askpass
> 
> then try replacing that line with
> 
>   export SSH_ASKPASS=/usr/lib64/ssh/ssh-askpass

This is what I was suggesting in the initial post that started the mailinglist thread, back in 2015-09-18.

When I do the change, it works. But the change that broke it, came from the openssh-askpass-common package. (which comes from the openssh src.rpm)

CC: (none) => cooker

Comment 6 Barry Jackson 2016-06-30 01:31:25 CEST
The change in #1 has worked for me but now (today) does not.
There is no longer the askpass dialog on boot/re-login and on launching konsole (plasma) there is just:
 * Error: Problem adding; giving up

CC: (none) => zen25000

Comment 7 Barry Jackson 2016-06-30 15:48:13 CEST
Is there any other workaround for this?
Comment 8 Guillaume Rousse 2016-06-30 16:07:58 CEST
That bug report is very confusing, mixing issues related to SSH itself, the SSH agent, and SSH agent passphrase-handling user interfaces...

comment #1: it is perfectly normal to have automated SSH session expiry, that's a server setting, just check with your server admin first before assuming it is an SSH issue

comment #2: yes, there was an issue with the install path of openssh-askpass-qt4 binary, but this was reported and fixed elsewere

comment #3: check if you have an agent running:
[guillaume@netchaiev ~]$ ssh-add -l
Could not open a connection to your authentication agent.
In this case, there is no agent running, no need to blame the passphrase popup windows (which is a distinct optional software component)
Comment 9 Guillaume Rousse 2016-06-30 16:08:29 CEST
Sorry, the last item was related to comment #7, not comment #2.
Comment 10 Barry Jackson 2016-06-30 17:20:56 CEST
(In reply to Guillaume Rousse from comment #9)
> Sorry, the last item was related to comment #7, not comment #2.

Thanks, the output of ssh-add -l was the clue

[baz@localhost ~]$ ssh-add -l
The agent has no identities.

Running "ssh-add" seems to have fixed things, although logging out/in did not cause askpass dialog to ask for PW. I will see what happens on reboot.
I can now run a script that accesses mageia svn without being prompted repeatedly for a password. :)
Comment 11 Barry Jackson 2016-06-30 17:35:05 CEST
Back to square one after re-boot (no askpass dialog appeared):

 * Error: Problem adding; giving up
[baz@localhost ~]$ ssh-add -l
The agent has no identities.
[baz@localhost ~]$ ssh-add
Enter passphrase for /home/baz/.ssh/id_rsa: 
Identity added: /home/baz/.ssh/id_rsa (/home/baz/.ssh/id_rsa)
[baz@localhost ~]$ ssh-add -l
2048 SHA256:XXXXXXXXXXXXX/XXXXXXXXXXXXXX /home/baz/.ssh/id_rsa (RSA)
[baz@localhost ~]$ keychain

 * keychain 2.8.2 ~ http://www.funtoo.org
 * Found existing ssh-agent: 5017

[baz@localhost ~]$

[baz@localhost ~]$ rpm -qa|grep askpass
openssh-askpass-common-7.2p2-2.mga6
openssh-askpass-7.2p2-2.mga6
openssh-askpass-qt4-1.0.1-12.mga6
[baz@localhost ~]$

Any ideas?
Comment 12 Guillaume Rousse 2016-07-04 19:52:34 CEST
The whole point of keychain, as far as I remember, was to keep your credentials available after checkout, for cron tasks for example. Apart of it, I don't see any added value nowadays, just an additional potential source of troubles in this mix. Just get rid of it, and see if the problem persists.
Comment 13 Johnny A. Solbu 2016-07-04 20:57:42 CEST
This is what I did to solve it, after a pointer in a comment in bug 18812 about a similar problem, which I gather really is the same bug as this.

Uninstall openssh-askpass-common, which will uninstall all packages providing an ssh-askpass command. usually one or two packages.

Then I checked the content in /var/lib/alternatives/ssh-askpass and /var/lib/alternatives/ssh-askpass

Then ran «update-alternatives --remove ssh-askpass » and the path to any askpass commands listed in the alternatives file.
Do the same for bssh-askpass: «update-alternatives --remove bssh-askpass» and the path listed in the bssh-askpass alternatives file.

Then installed openssh-askpass-qt4, and everything worked again.
Comment 14 Johnny A. Solbu 2016-07-04 20:59:14 CEST
(In reply to Johnny A. Solbu from comment #13)
> Then I checked the content in /var/lib/alternatives/ssh-askpass and
> /var/lib/alternatives/ssh-askpass

Baah, stupid typo. :-) 
One of the files should be /var/lib/alternatives/bssh-askpass
Comment 15 Barry Jackson 2016-07-05 00:51:28 CEST
(In reply to Johnny A. Solbu from comment #13)
> This is what I did to solve it, after a pointer in a comment in bug 18812
> about a similar problem, which I gather really is the same bug as this.
> 
> Uninstall openssh-askpass-common, which will uninstall all packages
> providing an ssh-askpass command. usually one or two packages.
> 
> Then I checked the content in /var/lib/alternatives/ssh-askpass and
> /var/lib/alternatives/ssh-askpass
> 
> Then ran «update-alternatives --remove ssh-askpass » and the path to any
> askpass commands listed in the alternatives file.
> Do the same for bssh-askpass: «update-alternatives --remove bssh-askpass»
> and the path listed in the bssh-askpass alternatives file.
> 
After doing the above in /var/lib/alternatives/ssh-askpass I have:

auto
/usr/lib64/ssh/ssh-askpass

/usr/lib64/seahorse/seahorse-ssh-askpass
15

and in /var/lib/alternatives/bssh-askpass I have:

auto
/usr/bin/ssh-askpass

/usr/lib64/seahorse/seahorse-ssh-askpass
15
/usr/libexec/openssh/qt4-ssh-askpass
50

Does any of that look right?

> Then installed openssh-askpass-qt4, and everything worked again.

Nothing changed for me :\

I will try removing the packages and both alternative files to see if they get re-created correctly.
Comment 16 Barry Jackson 2016-07-05 01:00:25 CEST
(In reply to Barry Jackson from comment #15)

> 
> Nothing changed for me :\
> 
> I will try removing the packages and both alternative files to see if they
> get re-created correctly.

That worked - it is now working correctly after a log-out/in.

I removed openssh-askpass-common
Re-named /var/lib/alternatives/ssh-askpass and /var/lib/alternatives/bssh-askpass to effectively remove them.
Installed openssh-askpass-qt4

...and it works :)

Thanks Johnny - that has been a real pain!
Comment 17 Barry Jackson 2016-07-05 01:19:36 CEST
(In reply to Guillaume Rousse from comment #12)
> The whole point of keychain, as far as I remember, was to keep your
> credentials available after checkout, for cron tasks for example. Apart of
> it, I don't see any added value nowadays, just an additional potential
> source of troubles in this mix. Just get rid of it, and see if the problem
> persists.

I really have no idea how all this ties together, but without keychain, askpass does not ask for PW, with it I am asked for PW as desktop appears.
Comment 18 papoteur 2017-05-17 21:24:12 CEST
Hello, 
I come back with this problem that I filed at first, which is not a ssh connection problem but that the terminal  window closes itself after some time.

I encounter this problem today in a Plasma session. I think it's a new Virtual machine, but not sure.
I have no more openssh. Konsole has been closed without asking anything. :(
Comment 19 Guillaume Rousse 2017-05-26 15:36:42 CEST
According to comment#18, this is not an openssh issue.

Source RPM: openssh => (none)
Assignee: guillomovitch => bugsquad

Comment 20 Marja Van Waes 2018-03-14 09:06:04 CET
Closing this report as OLD, because there was no more action in it since over 9 months ago and _mostly_ because it is too confusing with all the comments about openssh in it, that are unrelated to the original issue.

Please file separate reports (if they don't already exist) for any remaining issues.

Status: NEW => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.