X forwarding and ssh

How would I go about forwarding an X11 program to an arbitrary host while using ssh?  

Here's an example:
Bob sshs into host#1(   I'm on host#2 and I want to send a display to him.  So I type xterm -display

It works fine if he simply telnets to host#1 but not if he uses ssh.  We must use ssh because some people will be connecting though a proxy into our internal LAN.

The error message I get is:
X11 connection rejected because of wrong authentication.

I'm assuming this error comes from the fact that I don't have the authority to use his X11 forwarding that ssh has automatically set up.  Is there any way to get around this?  With his approval of course.

Who is Participating?
n0thingConnect With a Mentor Commented:
Sorry, I misunderstand the question. Try to recompile the deamon, make sure that the program "xauth" is in your path when you compile it. DO a find /usr -name xauth -print to see where it is and add the path to your current path. Reconfigure ssh and rebuild it.

Minh Lai

   I don't know where the ssh config file is on that system. But it is usually under /etc/sshd_config.
Check for the line :
"X11Forwarding no"
change it to "X11Forwarding yes" and restart the sshd deamon.
You will need root in order to do this.

Minh Lai

markhortonAuthor Commented:
The problem is that I am not doing X11 forwarding to myself.  The X11 forwarding to myself works correctly.  I am trying to start an X application and forward it to someone else's screen.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.