Link to home
Start Free TrialLog in
Avatar of fuze44
fuze44Flag for United States of America

asked on

What port does X11 Forwarding with SSH use?

I'm using Putty and Xming on Windows to connect to an AIX box.  I'm connecting via SSH, but when I launch an application, it always comes back to the Windows box on port 6000.

I know 6000 is default for X11, but I thought the app would come to the Windows system on port 22 since it's using SSH.

Please advise.  I'm working hard to understand this.
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Make sure that PuTTY's X11 forwarding is enabled.

Configuration -> SSH -> X11 -> tick "Enable X11 forwarding". Leave "X display location" empty.

Make sure that all settings are saved in the session profile.

Once you're logged in to your target host, check the DISPLAY variable.

It should be: "localhost:10.0"

Never ever set the DISPLAY variable to something else (e. g. to the address of your Windows machine, as you would do without SSH tunneling).
Avatar of fuze44

ASKER

I have done all of that, but when $DISPLAY shows to be localhost:10.0 no windows will open.  

Xming (the Windows X Server) is using display 0.  Should it be changed to 10?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fuze44

ASKER

The X app is an old software engineering app from which I'm migrating the data to a new app.  I can get its windows to appear using just X11 without SSH by setting DISPLAY to my workstation's address via a Telnet session.  When I connect via SSH, I get an error about not being able to open the window.

It will be Tuesday before I can get back on that system at work.   I'll get more details then and double check all of these settings.
"... not being able to open the _window_ " or rather "... to open the _display_"?
Avatar of fuze44

ASKER

Ok, I've been trying hard to get this to work.  BTW, this is OpenSSH that has been installed onto the AIX server.  Here's where things stand:

I can still bring up X Windows using telnet and setting my display to my local IP.  I then try it via SSH in Putty,  with X11 forwarding checked.  I leave the remote DISPLAY set to localhost:10.0, but when I try to start nedit or xterm, I get:

Xlib:  connection to "localhost:10.0" refused by server
Xlib:  PuTTY X11 proxy: wrong authentication protocol attempted
Error: Can't open display: localhost:10.0

I've edited my sshd_config file to have the following values:

AllowTcpForwarding yes
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes
XAuthLocation /usr/bin/X11/xauth

I've removed and regenerated the .Xauthority file.  I've restarted the ssh daemon.

I'm stuck.
Avatar of fuze44

ASKER

Also, here's the log from Putty:

2013-01-25 20:20:42      Looking up host "162.58.43.95"
2013-01-25 20:20:42      Connecting to 162.58.43.95 port 22
2013-01-25 20:20:42      Server version: SSH-2.0-OpenSSH_5.8
2013-01-25 20:20:42      We claim version: SSH-2.0-PuTTY_Release_0.60
2013-01-25 20:20:42      Using SSH protocol version 2
2013-01-25 20:20:42      Doing Diffie-Hellman group exchange
2013-01-25 20:20:42      Doing Diffie-Hellman key exchange with hash SHA-256
2013-01-25 20:20:45      Host key fingerprint is:
2013-01-25 20:20:45      ssh-rsa 2048 58:55:a8:1d:4e:f9:fc:82:6e:90:44:cc:36:fb:65:61
2013-01-25 20:20:45      Initialised AES-256 SDCTR client->server encryption
2013-01-25 20:20:45      Initialised HMAC-SHA1 client->server MAC algorithm
2013-01-25 20:20:45      Initialised AES-256 SDCTR server->client encryption
2013-01-25 20:20:45      Initialised HMAC-SHA1 server->client MAC algorithm
2013-01-25 20:20:46      Keyboard-interactive authentication refused
2013-01-25 20:20:48      Sent password
2013-01-25 20:20:48      Access granted
2013-01-25 20:20:48      Opened channel for session
2013-01-25 20:20:48      Requesting X11 forwarding
2013-01-25 20:20:48      X11 forwarding enabled
2013-01-25 20:20:48      Allocated pty (ospeed 38400bps, ispeed 38400bps)
2013-01-25 20:20:48      Started a shell/command

>> Right here I entered 'nedit'

2013-01-25 20:21:59      Received X11 connect request from 127.0.0.1:4242
2013-01-25 20:21:59      Opening X11 forward connection succeeded
2013-01-25 20:21:59      Forwarded X11 connection terminated
try to run the command

xhost +

before running nedit
Use MIT-Magic-Cookie-1 instead of XDM-Authorization-1 in PuTTY's session configuration.
Avatar of fuze44

ASKER

I am using Magic Cookies (although my log posted above may have indicated differently since I tried both).

As for xhost +, it just generates the same error as when I'm trying to run an app like nedit:

root(waas-tw)> xhost +
Xlib:  connection to "localhost:10.0" refused by server
Xlib:  PuTTY X11 proxy: wrong authentication protocol attempted
1356-200 xhost unable to open display "localhost:10.0"
Run "xhost +" on Xming, not on AIX.
Avatar of fuze44

ASKER

What do you mean run that on Xming?  There's no Xmine command line that I know of, nor is there a program called xhost installed with Xming, so that isn't recognize from Window's command line.

There is an -ac option which allows all clients.  That is in place.  There is also the X0.hosts file for specific hosts.  The remote machines is listed in there.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fuze44

ASKER

Ok, I got it working.  Every webpage I found said to set X11UseLocalhost to yes in sshd_config.  Turns out that 'no' is the correct setting for this configuration.

My cohorts behind the firewall can now receive X windows.
Avatar of fuze44

ASKER

Since the solution was something else, I awarded points for participation and information.  Thank you, all.