LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-08-2016, 08:58 PM   #1
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Rep: Reputation: Disabled
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.
 
Old 07-09-2016, 02:07 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,621

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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
 
Old 07-09-2016, 02:56 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
I am unfamiliar with xmanager but did you also configure x11 forwarding in PuTTy's X11 settings?
 
Old 07-09-2016, 06:13 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
Did you remember to restart the sshd service after making the changes?
 
Old 07-09-2016, 06:37 PM   #5
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by John VV View Post
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 View Post
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 View Post
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
 
Old 07-09-2016, 06:48 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,568

Rep: Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865Reputation: 5865
Stupid question but is a desktop running on that particular server?
 
Old 07-09-2016, 06:53 PM   #7
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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.
 
Old 07-09-2016, 06:59 PM   #8
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 748

Rep: Reputation: 156Reputation: 156
Quote:
Originally Posted by asun View Post
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

Last edited by timl; 07-09-2016 at 07:00 PM.
 
Old 07-09-2016, 07:29 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
Logged with ssh on server, what is the output with
Code:
netstat -an | grep '60.*LISTEN'
 
Old 07-09-2016, 07:35 PM   #10
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
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
 
Old 07-09-2016, 07:49 PM   #11
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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
 
Old 07-09-2016, 07:55 PM   #12
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
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.
 
Old 07-09-2016, 07:58 PM   #13
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
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
 
Old 07-09-2016, 08:02 PM   #14
asun
LQ Newbie
 
Registered: Mar 2015
Posts: 11

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by keefaz View Post
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.
 
Old 07-09-2016, 08:06 PM   #15
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Centos 7 - X11 forwarding bioshock Linux - Newbie 7 06-03-2015 01:46 PM
X11 Forwarding not working properly OpenSUSE 13.1 jborck Linux - General 1 06-20-2014 03:11 PM
IP Forwarding not working in CentOS 5 varunb Linux - Newbie 7 04-17-2012 03:05 AM
IP Forwarding not working in CentOS 5 tomwerner Linux - Networking 9 05-19-2008 11:47 AM
X11 Forwarding working with Cygwin, Failing under Linux AnSyn Linux - Networking 10 02-28-2007 12:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration