Page 2 of 2

Re: xterm xt error cannot open display

Posted: 2018/03/07 05:35:54
by Whoever

Code: Select all

ssh -Y <remote host>

Re: xterm xt error cannot open display

Posted: 2018/03/07 16:30:38
by phil.e
IPV6 is enabled.

Just to re-hash the steps I'm taking, because i think what I wrote before sounded fuzzy:

I'm using ssh -X <hostname> to login to this remote system, doing sudo su - to get to root, doing su - <username> to get to the username that's having the issue.

I'm issuing the command "echo $DISPLAY", expecting to see something like ":0.0" but getting "DISPLAY: Undefined variable" instead

I'm running the command "env | grep -i display", expecting to see some display configuration, but getting no response instead

When I run the command "xclock", I get "Error: Can't open display"

Re: xterm xt error cannot open display

Posted: 2018/03/07 16:52:25
by TrevorH
I'm using ssh -X <hostname> to login to this remote system, doing sudo su - to get to root, doing su - <username> to get to the username that's having the issue.

I'm issuing the command "echo $DISPLAY", expecting to see something like ":0.0" but getting "DISPLAY: Undefined variable" instead
That sounds like the correct behaviour to me. When you ssh in as root, it probably does have DISPLAY set for your initial user because of your ssh X11 forwarding but then you su to root and that will lose it and then you su to the user in question and that won't preserve it either. X11 forwarding doesn't work if you change user by design. The only bit that confuses me is the undefined variable - I've been unable to recreate that at all, I only ever get a display or a blank line. Like this:

Code: Select all

[trevor@trevor4 SPECS]$ ssh -X centos7
Last login: Wed Mar  7 16:50:39 2018 from trevor4
[trevor@centos7 ~]$ echo $DISPLAY
localhost:10.0
[trevor@centos7 ~]$ sudo su -
[sudo] password for trevor: 
Last login: Wed Mar  7 16:51:13 GMT 2018 on pts/0
[root@centos7 ~]# echo $DISPLAY

[root@centos7 ~]# su - trevor
Last login: Wed Mar  7 16:51:16 GMT 2018 from trevor4 on pts/0
[trevor@centos7 ~]$ echo $DISPLAY

[trevor@centos7 ~]$

Re: xterm xt error cannot open display

Posted: 2018/03/08 17:35:20
by phil.e
Ok, after some meeting of the minds with some other admins around here, we were able to recreate the issue the user was having and find a resolution for it.

It involved:

A setting in /etc/gdm/gdm-schemas - changed security/DisallowTCP to "False"

Adding these two options to /etc/gdm/custom.conf

[security]
DisallowTCP=False (probably repetitive considering previous step)

[xdmcp]
Enable=True

Thanks all for your help and assistance!