LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 09: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, 03:07 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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, 03:56 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,943

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

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
Did you remember to restart the sshd service after making the changes?
 
Old 07-09-2016, 07: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, 07:48 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 14,943

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Stupid question but is a desktop running on that particular server?
 
Old 07-09-2016, 07: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, 07:59 PM   #8
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 582

Rep: Reputation: 127Reputation: 127
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 08:00 PM.
 
Old 07-09-2016, 08:29 PM   #9
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
Logged with ssh on server, what is the output with
Code:
netstat -an | grep '60.*LISTEN'
 
Old 07-09-2016, 08: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, 08:49 PM   #11
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
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, 08: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, 08:58 PM   #13
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
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, 09: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, 09:06 PM   #15
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 5,387

Rep: Reputation: 397Reputation: 397Reputation: 397Reputation: 397
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 02:46 PM
X11 Forwarding not working properly OpenSUSE 13.1 jborck Linux - General 1 06-20-2014 04:11 PM
IP Forwarding not working in CentOS 5 varunb Linux - Newbie 7 04-17-2012 04:05 AM
IP Forwarding not working in CentOS 5 tomwerner Linux - Networking 9 05-19-2008 12:47 PM
X11 Forwarding working with Cygwin, Failing under Linux AnSyn Linux - Networking 10 02-28-2007 01:44 PM


All times are GMT -5. The time now is 12:46 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration