X11 Forwarding using SSH

I used to operate Solaris server at work, and sometimes I need to use Desktop application from that server. I learned for the first time at Siemens Indonesia using export display from solaris machine into local machine (laptop) which run M$ Windows, at that time we have exceeds application inside laptop which can be used to retrieve X session from solaris. Exceeds act just like Xserver for Microsoft Windows.

This method is used until few months ago. I admit it was easy using exceeds especially for XDMCP Query or XDMCP broadcast protocol, using that protocol we can retrieve login session and log into that solaris machine. Unfortunately, I am using Mac OSX. And to do that, I had to fire-up my Windows under Virtual Machine or reboot and log into Microsoft Windows as my second boot OS. Usually it’s not a big problem, because what usually important is playing with “nwadmin”, it’s a window based administration tools for networker application. Networker application itself is a software for backup&restore within @vantage platform which I am handling at work.

While working in Georgia, the network is quite restricted. Somehow I can’t use my Windows virtual machine to run “nwadmin” remotely using “export display”. I have to reboot OSX and log into windows just to manage B&R window. It’s annoying. Later I tried to look another way retrieving solaris window application from my OSX.

I tried to follow using old method, that is using export display. But it was failed due to authentication. I already start X11 on my OSX, and perform “remote DISPLAY=<OSX_IP_ADDR:0.0>”, but it show error:

Xlib: Invalid MIT-MAGIC-COOKIE-1 key os x

That error appear on console of solaris, while from OSX it said client connection was rejected. I was trying to dig deeper about this “MIT-MAGIC-COOKIE” thing but unfortunately my attention was go to some statement on one forum which said it’s better to use SSH X Forwarding, it’s more secure. Well, system within HLRD these days also give more restriction for security, like hardening the operating system, using SSH instead of telnet or rlogin, etc. So I think it’s better to use SSH-X-Forwarding to get “nwadmin” windows.

Configuration is pretty easy. From solaris server just modify sshd configuration (/etc/ssh/sshd_config) to enable X11 Forwarding:

X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost yes

Restart sshd on solaris.

From X11 application on OSX, start terminal (xterm), and ssh using -X option to that server:

bash$ ssh -X root@[B&R_IP_ADDR]
root@B&R# nwadmin

Just run some X application, it will immediately show the window on our OSX Desktop.

Advertisements

One thought on “X11 Forwarding using SSH

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s