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 12-23-2014, 08:17 AM   #1
Sush093
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Rep: Reputation: Disabled
Xauthority issue : Error: Can't open display:


Hi Team

I am new member to the Unix world . I am trying to open xclock but it is getting failed . I have referred the forums solution but is not helping me out .
Please find the steps which i have taken : -

1> Have installed Xming .
2.> While Opening Putty , i have enabled the X11 Forwarding ( Checkbox ticked )
3.> I login to Putty , with my credentials
a.> Set the DISPLAY environment variable ( although it is already set in the .bash_profile .
DISPLAY=localhost:10.0
export DISPLAY
4.> Then launch xclock , but it gives error : Error: Can't open display:

Please guide .

Regards
 
Old 12-23-2014, 02:16 PM   #2
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
First, remove any definitions for the DISPLAY environment variable from any profile...

The correct value will be set by sshd when the login is successful.

IF there is no DISPLAY environment variable after login, then you are not running the X server on your workstation OR the machine you are logging in on has forwarding disabled (look in /etc/ssh/ssd_config to see if "X11Forwarding" has the value "no". If the line is commented out, then the value shown should be the compiled default, and you have to put a line "X11Forwarding yes" in, and restart the service).

The only time the :10 is valid is:

1. when the sshd_config file specifies an offset of 10(X11DisplayOffset) for the first connection - this is the default, but other values are possible.
2. this is the first connection.

After that the correct value can be 11, 12, 13... And those can occur for several reasons (usually network or client related). If the client system for instance gets rebooted the previous connection may still not have timed out and closed... thus the new connection would get 11.

Next, make sure the sshd_server has "X11UseLocalhost" enabled (otherwise you won't be allowing "localhost:nn" to be a valid display). This the usual value is "yes".

Last edited by jpollard; 12-23-2014 at 02:26 PM.
 
Old 12-23-2014, 07:55 PM   #3
Sush093
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Jpollard

Yes in the sshd_config the below 3 parameters are already enabled :

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

And thd sshd_config was restarted , but still then it is not working .

Upon your suggestion i removed the DISPLAY entry from bash_profile and bashrc , but it is still not working . To be specific can you also specify the profile so that i can cross check .

Are there any other reasons for which it is failing .

Regards
 
Old 12-24-2014, 02:18 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
configuration of Xming/putty... but I can't help with those.

There is no profile for sshd. It will create the environment variable. When you login you should be able to see the value assigned using "echo $DISPLAY". Your profile/bashrc files will be added. So you you redefine the DISPLAY environment variable it would have to have the SAME value as what was assigned - or it won't work.
 
  


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] try to open xclock and get Error: Can't open display thohogan Linux - Newbie 3 10-07-2013 04:19 PM
F13 + open Nvidia driver + compiz display issue airswit Fedora 8 06-12-2010 07:11 AM
help with an Error for .Xauthority bean89032 Linux - Networking 0 04-14-2006 10:25 AM
Xauthority error? jmr0311 Mandriva 4 12-15-2005 09:13 AM
.Xauthority error under vnc netkepala Linux - Networking 1 01-13-2004 11:19 AM

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

All times are GMT -5. The time now is 10:34 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