LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   X11 forwarding not working (Centos 6.4) (https://www.linuxquestions.org/questions/linux-newbie-8/x11-forwarding-not-working-centos-6-4-a-4175584140/)

asun 07-08-2016 08:58 PM

X11 forwarding not working (Centos 6.4)
 
Hello,

I'm trying to setup X11 forwarding on a server (CentOS 6.4), but it's not working.

On the client side (Windows), I've tried connecting both with XManager and using putty with xming, (which both work on other CentOS servers) but they fail with this one server. I can ssh fine, but I'm getting this error: "The remote SSH server rejected X11 forwarding requests."

On the server side, I have checked that 'X11Forwarding yes' has been uncommented in '/etc/ssh/sshd_config' and my iptables are accepting 'lo' and port '22'.

One strange thing that is happening is that the xhost command always returns: 'xhost: unable to open display ""'. I also checked to see if the $Display variable was defined and it is not.

I'm at a loss of what to do next and any help is appreciated. Thank you.

John VV 07-09-2016 02:07 PM

first thing before you get too far
6.4 6.5,6.6,and 6.7 are ALL unsupported

please upgrade to the ONLY supported version in the 6 series
CentOS 6.8

Code:

cat /etc/redhat-release
that NEEDS to be 6.8

there are no repos for 6.4 except the historical Vault

michaelk 07-09-2016 02:56 PM

I am unfamiliar with xmanager but did you also configure x11 forwarding in PuTTy's X11 settings?

jpollard 07-09-2016 06:13 PM

Did you remember to restart the sshd service after making the changes?

asun 07-09-2016 06:37 PM

Quote:

Originally Posted by John VV (Post 5573171)
first thing before you get too far
6.4 6.5,6.6,and 6.7 are ALL unsupported

please upgrade to the ONLY supported version in the 6 series
CentOS 6.8

Code:

cat /etc/redhat-release
that NEEDS to be 6.8

there are no repos for 6.4 except the historical Vault


Ok, I can update the version, but I don't think this is the issue, since all the other servers I can connect to and forward X11 are the exact same old version.


Quote:

Originally Posted by michaelk (Post 5573205)
I am unfamiliar with xmanager but did you also configure x11 forwarding in PuTTy's X11 settings?

Yes, the X11 forwarding option in the putty settings is enabled and I know my settings work with other similar servers.

Quote:

Originally Posted by jpollard (Post 5573270)
Did you remember to restart the sshd service after making the changes?

Yes, even though X11 forwarding was already on in the sshd_config file, I still used the following just to be sure:

Code:

sudo service sshd restart

michaelk 07-09-2016 06:48 PM

Stupid question but is a desktop running on that particular server?

asun 07-09-2016 06:53 PM

Quote:

Originally Posted by michaelk (Post 5573279)
Stupid question but is a desktop running on that particular server?

Sorry, what do you mean by desktop? I do currently have an open VNC session tunneled through ssh on that server. It's running kde if that's what you mean.

timl 07-09-2016 06:59 PM

Quote:

Originally Posted by asun (Post 5573280)
Sorry, what do you mean by desktop? I do currently have an open VNC session tunneled through ssh on that server. It's running kde if that's what you mean.

I think Michael may be asking whether the Centos server has been set up to run X11 services. I believe the basic install covers CLI only.

[EDIT] sorry, just reread your response which answers this question. Please ignore

keefaz 07-09-2016 07:29 PM

Logged with ssh on server, what is the output with
Code:

netstat -an | grep '60.*LISTEN'

asun 07-09-2016 07:35 PM

Quote:

Originally Posted by keefaz (Post 5573293)
Logged with ssh on server, what is the output with
Code:

netstat -an | grep '60.*LISTEN'

Hi, here it is:

Code:

tcp        0      0 0.0.0.0:42608              0.0.0.0:*                  LISTEN
tcp        0      0 0.0.0.0:6001                0.0.0.0:*                  LISTEN
tcp        0      0 :::6001                    :::*                        LISTEN


keefaz 07-09-2016 07:49 PM

Looks like X is running and listening on port tcp 6001
If X was forwarded, you should see additional lines like
Code:

tcp        0      0 127.0.0.1:6010          0.0.0.0:*              LISTEN
tcp6      0      0 ::1:6010                :::*                    LISTEN

.Xauthority permissions have read/write set for your user?
Code:

ls -l ~/.Xauthority

asun 07-09-2016 07:55 PM

Quote:

Originally Posted by keefaz (Post 5573303)
Looks like X is running and listening on port tcp 6001
If X was forwarded, you should see additional lines like
Code:

tcp        0      0 127.0.0.1:6010          0.0.0.0:*              LISTEN
tcp6      0      0 ::1:6010                :::*                    LISTEN

.Xauthority permissions have read/write set for your user?
Code:

ls -l ~/.Xauthority

Yes, I get the following for my user:

Code:

-rw-------. 1 XXXX XXXX XX X  X XX:XX .Xauthority
I added the Xs, but the username and group are what I expect.

keefaz 07-09-2016 07:58 PM

Is there a localhost entry in /etc/hosts, like:
Code:

127.0.0.1              localhost
Is there something on output with (may need to run it as root):
Code:

dmesg | grep sshd

asun 07-09-2016 08:02 PM

Quote:

Originally Posted by keefaz (Post 5573306)
Is there a localhost entry in /etc/hosts, like:
Code:

127.0.0.1              localhost
Is there something on output with (may need to run it as root):
Code:

dmesg | grep sshd

This is in /etc/hosts:

Code:

127.0.0.1  localhost          localhost.localdomain
127.0.0.1  [server address]    [server name]

Also, running that line of code as root returns nothing.

keefaz 07-09-2016 08:06 PM

I don't understand the [server address] on 127.0.0.1 second line, is there an IP here?


All times are GMT -5. The time now is 11:27 PM.