Page 1 of 1

X Window through SSH through RDC

Posted: Wed Jun 15, 2011 7:35 am
by pikaporeon
Alright I have a weird problem
I have an AIX box in our lab (not physically accessable) that due to subnetting can only be accessed via SSH.. through a WS2k8 'jump server' on both subnets via windows RDC. X window doesn't seem to be working, apparently due to the two layers of seperation

Regardless of what I have $DISPLAY set to, it can't open display, even when trying to xhost +.

I was told abstractly to "install xming it'll sort it all out" on the windows server but that hasn't helped at all.

Any helpful stepping stones in the right direction?

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 7:41 am
by notfred
Don't futz with the DISPLAY variable at all, try to ssh all the way through and it should set the DISPLAY variable automagically to the correct thing. You may need to add the "-Y" option to your ssh command, although I thought that was the default these days.

I'm not quite sure what you mean by the WS2k8 server with RDC in the middle. Your connection needs to be ssh all the way to have any chance of success, including ssh into one box and then ssh from there on to another box.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 8:48 am
by pikaporeon
notfred wrote:
Don't futz with the DISPLAY variable at all, try to ssh all the way through and it should set the DISPLAY variable automagically to the correct thing. You may need to add the "-Y" option to your ssh command, although I thought that was the default these days.

I'm not quite sure what you mean by the WS2k8 server with RDC in the middle. Your connection needs to be ssh all the way to have any chance of success, including ssh into one box and then ssh from there on to another box.

The Windows Server 2008 server I need to get on the same subnet does not have any form of ssh configured outside of me running putty to get onto the server I actually need to work with.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 9:18 am
by notfred
You are going to need to get some form of ssh server on that Windows box, then you ssh to that Windows box and then ssh again from there to the AIX box.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 9:27 am
by bthylafh
Failing that, you can use psexec to "telnet" (not really) into the Windows server[1], then use a command-line SSH client installed on the Windows server to get into the remote AIX box.

This may be sub-optimal; I have no idea if psexec encrypts its connexions or not.

Cygwin has an sshd you could use if this isn't feasible, you just need to read the documentation and it'll set you right.

[1] "psexec \\servername cmd" will get you in, assuming your workstation is a Windows machine.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 10:14 am
by fr500
Where do you have Xming installed? you need to install Xming on the W2k8 server.

I'd go this route:

- Install Xming
- Install Cygwin (add mintty just to have a nice console)
- Fire mintty and run:

export DISPLAY=localhost:0

- Fire xming
- SSH into your server with -Y and -C options
- Start your graphical app

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 10:17 am
by fr500
I use that everyday...If it works you might append

export DISPLAY=localhost:0

in .bashrc so you don't have to run it everytime

Also a better solution would be to add an static route on you PC to the AIX server's network via the W2K8 server. You'd need to enable routing in the 2k8 box so I don't know it that's feasible but that would allow you to access AIX server from your PC directly removing the RDP from the equation

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 10:31 am
by pikaporeon
I'll give that a shot. I'm worried the jump server might be too locked down for that though

Out of curiousity, any reason why I can't just get the X windows to pop up on the jump server? like whats the technical limitation im running into?

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 11:53 am
by Flatland_Spider
pikaporeon wrote:
Out of curiousity, any reason why I can't just get the X windows to pop up on the jump server? like whats the technical limitation im running into?


Windows doesn't have an X Server installed by default.

Here's what happening.
1) ssh session is established with X11 forwarding enabled.
2) GUI program is started.
3) GUI program starts sending GUI data over the ssh connection to be received by the X server on the local computer.
4) X Server renders the GUI elements with all the processing happening on the server.

You don't have an X Server, so step 4 never happens, and possibly, step 3 doesn't happen if you don't specify X11 forwarding in PuTTY.

Try MobaXterm. You don't have to install anything, and the X Windows environment is already setup. You should be able to issue "ssh username@server" then "xterm &" with everything just working. I haven't used MobaXterm in a while, since I got a dedicated Linux box at work, but that's the way it used to work, if I remember correctly. If that doesn't work, you may need to issue "ssh -X username@server" to get the tunneling working.

MobaXterm
http://mobaxterm.mobatek.net/

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 12:02 pm
by fr500
pikaporeon wrote:
I'll give that a shot. I'm worried the jump server might be too locked down for that though

Out of curiousity, any reason why I can't just get the X windows to pop up on the jump server? like whats the technical limitation im running into?



The first instructions I gave you should work on the jump server.

Flatland is right, Windows doesn't have an Xserver, that's what's Xming is going to do.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 12:13 pm
by zzatz
I'd step back from the technical problem and look at the bigger picture. Ask your network folks for a direct route. If there is a legitimate policy reason why you can't have a direct route, then working around it could get you fired. If there's no policy reason, but they won't do it anyway, write a memo to your boss explaining why you need this to do your job and asking him to deal with the appropriate manager to get this resolved.

Adding a route between two known addresses to the Windows server shouldn't be a big deal, unless, of course, it violates some policy.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 12:35 pm
by Flatland_Spider
zzatz wrote:
I'd step back from the technical problem and look at the bigger picture. Ask your network folks for a direct route. If there is a legitimate policy reason why you can't have a direct route, then working around it could get you fired. If there's no policy reason, but they won't do it anyway, write a memo to your boss explaining why you need this to do your job and asking him to deal with the appropriate manager to get this resolved.

Adding a route between two known addresses to the Windows server shouldn't be a big deal, unless, of course, it violates some policy.

Re: X Window through SSH through RDC

Posted: Wed Jun 15, 2011 1:07 pm
by pikaporeon
derp.

The problem was sshd on the aix server had X11 forwarding disabled <_<;

Thanks a lot for your help anyway guys.