Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Problem with X11 export Display

Dear, I had some questions about X11 and ssh under Mac OS X 10.5. I hope I post the message into the good topic.

My problem :

I have a Mac Pro I use as a server (I will call him HOST hereafter) and I want to be able to connect on it via ssh with X11 forwarding. Therfore, I connect using

xhost +
ssh -Y login@host

- When the local computer is a Mac, under Os X 10.5, the X11 export display work perfectly.
- When the local computer is a linux computer, I got the message +can not export display on local machineIP:0.0+

The X11 server is automatically launch by my .bash_profile if not already running. The two options from the security pannel of the X11.app preference pannel are set to true.
In order the X11 forwarding works when I connect using my local Mac, I setup the environment variable DISPLAY in my .bash_profile by

export DISPLAY=local machinIP:0.0

I do exactly the same steps from the LINUX local machine but I still can not Forward X11 from the host to the local machine.

What is wrong ?
Here is the information provided by ssh -vvv when I try to connect on Host, using a local linux machine


+ssh(6130) debug1: Reading configuration data /etc/ssh/ssh_config+
+ssh(6130) debug1: Applying options for *+
+ssh(6130) debug2: ssh_connect: needpriv 0+
+ssh(6130) debug1: Connecting to host [host_ip] port 22.+
+ssh(6130) debug1: Connection established.+
+ssh(6130) debug1: Remote protocol version 2.0, remote software version+
OpenSSH_5.1
...
+ssh(6130) debug1: Host 'host' is known and matches the+
+RSA host key.+
+ssh(6130) debug1: Found key in $HOME/.ssh/known_hosts:27+
+ssh(6130) debug2: bits set: 529/1024+
+ssh(6130) debug1: ssh rsaverify: signature correct+
+ssh(6130) debug2: kex derivekeys+
+ssh(6130) debug2: set_newkeys: mode 1+
+ssh(6130) debug1: SSH2 MSGNEWKEYS sent+
+ssh(6130) debug1: expecting SSH2 MSGNEWKEYS+
+ssh(6130) debug2: set_newkeys: mode 0+
+ssh(6130) debug1: SSH2 MSGNEWKEYS received+
+ssh(6130) debug1: SSH2 MSG_SERVICEREQUEST sent+
+ssh(6130) debug2: service_accept: ssh-userauth+
+ssh(6130) debug1: SSH2 MSG_SERVICEACCEPT received+
...
+ssh(6130) debug1: Authentications that can continue:+
publickey,password,keyboard-interactive
+ssh(6130) debug3: start over, passed a different list+
publickey,password,keyboard-interactive
...
Password:
+ssh(6130) debug3: packet_send2: adding 32 (len 22 padlen 10 extra_pad 64)+
+ssh(6130) debug2: input userauth_inforeq+
+ssh(6130) debug2: input userauth_inforeq: num_prompts 0+
+ssh(6130) debug3: packet_send2: adding 48 (len 10 padlen 6 extra_pad 64)+
+ssh(6130) debug1: Authentication succeeded (keyboard-interactive).+
+ssh(6130) debug1: channel 0: new [client-session]+
+ssh(6130) debug3: ssh session2open: channel_new: 0+
+ssh(6130) debug2: channel 0: send open+
+ssh(6130) debug1: Entering interactive session.+
+ssh(6130) debug2: callback start+
*+ssh(6130) debug2: x11 getproto: /usr/bin/X11/xauth list 😮.0 2>/dev/null+*
*+ssh(6130) debug1: Requesting X11 forwarding with authentication spoofing.+*
*+ssh(6130) debug2: channel 0: request x11-req confirm 0+*
+ssh(6130) debug2: client session2setup: id 0+
+ssh(6130) debug2: channel 0: request pty-req confirm 0+
+ssh(6130) debug3: tty makemodes: ospeed 38400+
+ssh(6130) debug3: tty makemodes: ispeed 38400+
+ssh(6130) debug3: tty makemodes: 1 3+
+ssh(6130) debug3: tty makemodes: 2 28+
+ssh(6130) debug3: tty makemodes: 3 127+
...
+ssh(6130) debug3: tty makemodes: 93 0+
+ssh(6130) debug2: channel 0: request shell confirm 0+
+ssh(6130) debug2: fd 3 setting TCP_NODELAY+
+ssh(6130) debug2: callback done+
+ssh(6130) debug2: channel 0: open confirm rwindow 0 rmax 32768+
+ssh(6130) debug2: tcpwinsz: 87380 for connection: 3+
+ssh(6130) debug2: channel 0: rcvd adjust 2097152+
+Last login: Wed Jan 14 15:39:48 2009 from local_IP+
*+xhost: unable to open display ""+*

MacPro, Mac OS X (10.5.6)

Posted on Jan 14, 2009 7:48 AM

Reply
Question marked as Best reply

Posted on Jan 14, 2009 9:27 AM

With ssh X-forwarding, you should not use xhost at all. And ssh will set DISPLAY on the remote machine. You must not interfere with that. Do not set it manually, and be sure you do not have profile that sets DISPLAY. The ssh-set DISPLAY should look like "localhost:10.0". The number 10 might be different, but the name should be literally the word "localhost", not an IP address.
2 replies
Question marked as Best reply

Jan 14, 2009 9:27 AM in response to Andamion

With ssh X-forwarding, you should not use xhost at all. And ssh will set DISPLAY on the remote machine. You must not interfere with that. Do not set it manually, and be sure you do not have profile that sets DISPLAY. The ssh-set DISPLAY should look like "localhost:10.0". The number 10 might be different, but the name should be literally the word "localhost", not an IP address.

Jan 14, 2009 12:40 PM in response to Jeffrey Jones2

On the local mac, if I *echo $DISPLAY* the *DISPLAY* environment variable is not defined (return an empty line). On the local linux machine *DISPLAY=:0.0*

Now, if I connect on the remote MacPro via ssh -X or ssh -Y and I prompt on shell *echo $DISPLAY*, the *DISPLAY* is empty (echo return an empty line). it was the reason I used *xhost +* (before connect via ssh) and why I *export DISPLAY=local_IP:0.0* after being connected. By doing this, it works perfectly form mac to mac. Therefore, I was thinking it was the solution to forward X11 from Mac to Linux.

Note that I copied the /etc/ssh_config onto my *$HOME/.ssh/* directory and set to yes *X11Forwarding* on the host (when I tried to change X11Forwarding directly from /etc/ssh_config directroy, shell informs me that I do not have permission to change the file, even if I use the sudo command).

Any way, I will try again your method. It is a new MacPro and I set up the ssh connection from mac to mac via intranet. Recently I update Leopard. May be with the update, it will change something.

Message was edited by: Andamion

Problem with X11 export Display

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.