Bug 239395

Summary: can't start forwarded X11 consolehelper apps on remote SSH server
Product: [Fedora] Fedora Reporter: Adam Monsen <haircut>
Component: sudoAssignee: Daniel Kopeček <dkopecek>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: medium    
Version: 10CC: david.craigon, mitr, nik, tmraz, triage, Triv
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: i686   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-18 05:55:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 438944    
Description Flags
RPMs installed on box_b
RPMs installed on box_c
requested info on box_b and box_c none

Description Adam Monsen 2007-05-08 05:01:27 UTC
Description of problem:
I'm SSH'ing into a remote server. X11 Forwarding appears to be working fine, as
does sudo. For instance:

[box_a]$ ssh -X box_b
Last login: Sun Apr 22 11:22:39 2007 from box_a
[box_b]$ sudo xev

And the X11 event tester pops up right away, running as root.

However, when I try to run virt-manager or system-config-lvm, I get an error:

[box_b]$ sudo virt-manager
X11 connection rejected because of wrong authentication.
The application 'virt-manager.py ' lost its connection to the display
most likely the X server was shut down or you killed/destroyed
the application.

I'm thinking that an RPM install failed or I don't have an RPM I need. Perhaps a
"Requires" directive is missing from the 'usermode' specfile

Version-Release number of selected component (if applicable):
usermode-1.87-3, as installed with Fedora Core 6.

How reproducible:

Steps to Reproduce:
1. Install minimal Fedora Core 6, including openssh-server and an app that uses
consolehelper, like virt-manager. Allow X11 forwarding over SSH
2. SSH into minimal Fedora Core 6 instance, forwarding X11
3. Attempt to start virt-manager

Actual results:
Error occurs as shown in "Description of problem" section of this bug report.

Expected results:
Application would start on local display.

Additional info:
* "su -" then "virt-manager" _does_ work
* box_b is a fairly minimal Fedora Core 6 install with packages installed only
as they were required. I wouldn't be surprised if 'yum groupinstall "X Windows
System"' would make this work, but why should I have to install the whole
kitchen sink?
* box_b does have the 'xorg-x11-xauth' package installed.
* I can ssh from box_a to box_c and "sudo virt-manager" works fine, where box_c
is a more "kitchen-sink" install of Fedora Core 6 (includes a GNOME desktop and
lots of packages)
* I've inspected and recreated the sudoers file on box_b, only uncommenting the
line that allows people in group wheel to run all commands without a password
* "rpm -aV" returns tons of prelink errors, so it's tough to see what of the OS
has been changed on disk
* pinged fedora-list with this problem:
* an old but possibly related issue from 2004:

Comment 1 Adam Monsen 2007-05-08 05:01:27 UTC
Created attachment 154313 [details]
RPMs installed on box_b

Comment 2 Tomas Mraz 2007-05-08 19:48:02 UTC
Does 'sudo /usr/sbin/virt-manager' work?

Are both box_b and box_c fully updated from Fedora updates?

usermode probably doesn't forward/set $XAUTHORITY right.

Comment 3 Adam Monsen 2007-05-09 05:16:57 UTC
> Does 'sudo /usr/sbin/virt-manager' work?


> Are both box_b and box_c fully updated from Fedora updates?

Yes, at least most of the packages I thought would make any difference.

Comment 4 Adam Monsen 2007-05-09 05:27:56 UTC
Created attachment 154377 [details]
RPMs installed on box_c

Comment 5 Adam Monsen 2007-05-09 05:31:38 UTC
> Are both box_b and box_c fully updated from Fedora updates?

Here's a more accurate answer: No.

But I'm happy to try updating all or some of the packages on one or both machines.

Comment 6 W.C. Epperson 2007-05-09 16:03:08 UTC
Also see similar bug 239570.  It's odd that I can reproduce the common symptoms
on every environment I have EXCEPT the Fedora 6 one noted in this bug (239395).

Comment 7 Miloslav Trmač 2007-05-15 20:15:31 UTC
Please run the following commands:
  uname -n
  cat /etc/hosts
  echo $DISPLAY
  xauth list
  su - -c '(echo $XAUTHORITY; xauth list)'

on both box_b and box_c, and paste the results.

Comment 8 Adam Monsen 2007-05-16 03:51:04 UTC
Created attachment 154793 [details]
requested info on box_b and box_c

Here is the information you requested.

Comment 9 Miloslav Trmač 2007-05-16 11:23:35 UTC
Thank you, reproduced.

This is unrelated to usermode: (sudo su - -c xeyes) doesn't work either.

This happens because ssh uses the default Xauthority file, and does not set
XAUTHORITY, so libXau uses $HOME/.Xauthority.  sudo changes the uid, but not
$HOME, so the original $HOME/.Xauthority is still used.  Then, userhelper (or su
-) use the pam_xauth module.

pam_xauth does not use $HOME/.Xauthority, but "invoking user's home
directory"/.Xauthority, i.e. /root/.Xauthority, which does not exist.

So, pam_xauth should be using $HOME/.Xauthority if XAUTHORITY is not set and
$HOME/.Xauthority is readable by the invoking user.

You can use (XAUTHORITY=~/.Xauthority sudo virt-manager) as a work-around.

I'm afraid the above still does not explain the difference in behavior between
box_b and box_c.

Comment 10 Tomas Mraz 2007-07-25 15:22:29 UTC
This would be only a workaround. What's IMHO really broken is environment as set
up by sudo. It should call pam_xauth as well but currently simply adding the
module to sudo pam configuration doesn't help because it is calling
pam_open_session with empty $DISPLAY.

Comment 11 Miloslav Trmač 2007-07-27 11:55:16 UTC
I'm not sure whether the behavior of sudo is incorrect, but the behavior of
pam_xauth (using a different default path for .Xauthority than the X libraries_)
is definitely incorrect.

Comment 12 Bug Zapper 2008-04-04 00:35:37 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 13 Bug Zapper 2008-05-14 02:52:15 UTC
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:

Comment 14 Bug Zapper 2008-11-26 01:53:52 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 10 development cycle.
Changing version to '10'.

More information and reason for this action is here:

Comment 15 Gregory Trivett 2008-12-11 03:50:05 UTC
bumping this issue for fedora 10. From fedora 10 box to fedora 10 box using ssh -X or ssh -Y. env shows DISPLAY as localhost:10.0 and attempting to run any app (gnome-terminal, evolution..etc), errors with "Cannot open display:". From Fedora 10 box to Fedora 8 box using ssh -[XY] everything works. In Fedora 8, env shows localhost:10.0.

/etc/ssh ssh_config and sshd_config same between both fedora 10 and fedora 8 hosts.

Attempting to use straight ssh session, xhost + and export DISPLAY= does nothing and gives the same errors.

Comment 16 Tomas Mraz 2008-12-11 09:25:10 UTC
Gregory, are you talking about running apps through sudo or directly? Because this bug is only about problems when X apps are run from ssh session through sudo. If this is about directly running the X apps from ssh session it would be a completely new problem, so please open a new bug report for it against openssh.

Comment 17 Nik Lam 2009-04-25 15:19:24 UTC

I'm now noticing this problem on Fedora 10 x86_64 too. I used to be able to successefully run 

 sudo virt-manager

on a Centos 5 box with X forwarding activated and the virt-manager gui would display locally.

I haven't done it in a while and both operating systems have had packages updated several times since I last successfully ran it, so I'm not sure when the change occurred which is causing the problem. Other that package updates, nothing that I can think of on either the ssh server or client has been modified.

N.B. I'm running sshd on a non-standard port.

Here's an example of the ssh session:

[lnik@fedora10 ~]$ ssh -X -p 3923 centos5.example.com
lnik@centos5.example.com's password: 
Last login: Sun Apr 26 01:06:21 2009 from example123.dyn.example.com
# Centos5
/usr/bin/xauth:  creating new authority file /home/lnik/.Xauthority
[lnik@centos5 ~]$ sudo virt-manager 
X11 connection rejected because of wrong authentication.
The application 'virt-manager.py' lost its connection to the display localhost:10.0;
most likely the X server was shut down or you killed/destroyed
the application.
[lnik@centos5 ~]$

Comment 18 Bug Zapper 2009-11-18 08:11:58 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 

Comment 19 Bug Zapper 2009-12-18 05:55:32 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.