Solved

Xlib: No protocol specified

Posted on 2008-10-24
8
6,742 Views
Last Modified: 2013-12-27
Hi,
I have winXP on my desktop and have Xming X server installed. I daliy login to solaris and linux machines via putty ssh with X11 forwarding turned on to display solaris and linux X programs to my pc.

But today I logged on the a server I never been to before and there I could not display X programs. I've tried with ssh and telnet via putty. When I login via ssh with X11 forwarding I dont have any DISPLAY varible at all. Then I use telnet and set the DISPLAY variable manualy and then try to start a program I get the following error:

root@donald-bash# export DISPLAY=192.10.1.101:0
root@donald-bash# /usr/openwin/bin/xclock
Xlib: connection to "192.10.1.101:0.0" refused by server
Xlib: No protocol specified

Error: Can't open display: 192.10.1.101:0
root@donald-bash#

Why do I get this?
Is there a way to restrict X displays in the solaris/linux box?

0
Comment
Question by:tietohacker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 22

Expert Comment

by:blu
ID: 22795499
If you go to one of the other servers that works with X-forwarding, and change the DISPLAY variable to what you have above and then start xclock, does it work?

I think you have two separate problems.  One is that x-forwarding is not working on the new server. The other is why direct X connections (not over ssh) do not work.

I suspect that the direct X connections do not work for any of the servers, not just the new one. The reason you don't know that is that x-forwarding is working on the others.

As to the X-forwarding, the server must have x-forwarding configured in the sshd configuration file, otherwise X-forwarding does not work. On the new server, look for the file /etc/shh/sshd_config. In that file look for a line that says "X11Forwarding yes". If
that line does not exist or is commented out, that is the problem.
0
 

Author Comment

by:tietohacker
ID: 22795744
Hi blu,
I dont have any /etc/ssh dir at all. The sshd daemon exists under /usr/local/sbin and ssh + ssh-keygen etc. exists under /usr/local/bin.
If this dir doesent exists, can I create it and the file you mentioned?
0
 
LVL 22

Expert Comment

by:blu
ID: 22795960
Yes, that should work just fine. Take a look at the corresponding directory from the working servers. Do not copy any files other than the sshd_config file, the others are system specific.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:tietohacker
ID: 22811110
Blu,
I found the sshd_config file in /usr/local/etc/ dir. I made the changes and comment out:
X11Forwarding yes

Tried to login again, but no DISPLAY variable is set even if I have the "X11 forwarding" button marked in putty.
Also tried to create the /etc/ssh dir and placed the sshd_config file in that dir but that didnt work either.

Is there a way to see which config file sshd is useing and where it exists?

/T
0
 
LVL 22

Expert Comment

by:blu
ID: 22811616
You want to make sure "X11Forwarding yes" is not commented out.

Please uncomment it, then login in again. Do you get a DISPLAY variable set this time? If so, what is it set to?
0
 

Author Comment

by:tietohacker
ID: 22811959
No its not commented out.
Im sorry but I dont get the DISPLAY variable set after relogin.
/T
0
 
LVL 22

Accepted Solution

by:
blu earned 125 total points
ID: 22812177
The first thing to try is to look at the running sshd on the server. The command line option for setting the config file is
-f, so you can use /usr/ucb/ps auxwww to see if it is set on the top level sshd.

If not, look to see the path it is running from. From your description, it sounds like it is /usr/local/sbin. Look for the sshd binary in there. Then run this command "strings sshd | grep conf"

This should display the pre-compiled conf file location. Then go find that file and make sure that X11Forwarding is turned on there.
0
 

Author Comment

by:tietohacker
ID: 22812556
"ps -ef | grep sshd" tells me that the binary exists under /usr/local/sbin.
If I type "strings sshd | grep conf" it tels me that it uses /usr/local/etc/sshd_conf as the config file anfd that one I have chaged.

I then made:
"kill -HUP pid"
After a relogin everything works fine! It was only a HUP to the sshd process that was necessary.

THANKS!

/T
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question