Remote tasks sleeping after 'su'

Tzafrir Cohen
Fri Jan 25 00:10:00 GMT 2002

On Thu, 24 Jan 2002, Harold Hunt wrote:

> > -----Original Message-----
> > From:
> > []On Behalf Of Rob Haines
> > Sent: Thursday, January 24, 2002 12:32 PM
> > Subject: Remote tasks sleeping after 'su'
> >
> > I've been using Cygwin for a while now but am new to cygwin-xfree. I hope
> > this question hasn't been answered before but I did check the archives and
> > didn't find anything pertinent.
> >
> > I use this system to log into other systems (via ssh -X) and have the
> > windows displayed on my cygwin-xfree desktop. If I run something as myself
> > then everything is fine. If I log in, then 'su' to root, then run
> > something
> > the window never appears. If I look at 'top' then the task I just
> > started is
> > flagged as sleeping. This problem does not occur when using the
> > putty/exceed

Do you use *any* access limitations with exceed?

IIRC its default is to leave the display totally open. This allows anybody
in the neighbourhood to sniff characters from your display (xwd -display
<some other display> is one silly way), characters you type (like the root
password of the su command) and even inject characters.

> > combination to log in to my remote machine. I haven't tried
> > logging straight
> > in as root, because our security policy does not allow it. Is this a
> > cygwin-xfree issue, or something else?
> >
> Rob,

does 'ssh -v -X' give a better clue?

What version of ssh do you have on the remote machine?

Check your definitions of DISPLAY. If you connect to x-server-host to
other-system, then DISPLAY should be set to something like

Try launching a simple X client, like xcalc. I believe that those simple
programs tend to be netter at reporting X protocol errors than many other

> What you describe sounds logical.Remember, it is your username, not root,
> that has setup the X tunnelling through ssh.Therefore, it makes sense that
> an X client launched by root would not display.
> I'm not a great X user, so I could be wrong... but I do think that the above
> makes sense.

Some linux distros (e.g.: my mandrake 8.1) come with a pam module
(pam_xauth) that forwards the definition of DISPLAY and the XAUTHORITY  to
the user you are becoming (or only to root?)

Also, maybe the following voodoo would work:

su -c "env DISPLAY=${DISPLAY} XAUTHORITY=${HOME}/.Xauthority $SHELL" -

(Runs a shell as root, with DISPLAY set to the original value of DISPLAY,
and XAUTHORITY set to the user's XAUTHORITY file . As root, you can read

Tzafrir Cohen                        /"\        \ /  ASCII Ribbon Campaign
Taub 229, 972-4-829-3942,             X   Against  HTML  Mail   / \

More information about the Cygwin-xfree mailing list