xterm xt error cannot open display

General support questions
Whoever
Posts: 1089
Joined: 2013/09/06 03:12:10

Re: xterm xt error cannot open display

Post by Whoever » 2018/03/07 05:35:54

Code: Select all

ssh -Y <remote host>

phil.e
Posts: 48
Joined: 2018/02/13 20:28:14

Re: xterm xt error cannot open display

Post by phil.e » 2018/03/07 16:30:38

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"

User avatar
TrevorH
Forum Moderator
Posts: 27162
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: xterm xt error cannot open display

Post by TrevorH » 2018/03/07 16:52:25

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 ~]$
CentOS 6 will die in November 2020 - migrate sooner rather than later!
CentOS 5 has been EOL for nearly 3 years and should no longer be used for anything!
Full time Geek, part time moderator. Use the FAQ Luke

phil.e
Posts: 48
Joined: 2018/02/13 20:28:14

Re: xterm xt error cannot open display

Post by phil.e » 2018/03/08 17:35:20

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!

Post Reply

Return to “CentOS 6 - General Support”