Tuesday, June 2, 2009

Remote GUI administration of linux system in windows

Installing Xming on Windows

In order to do X11 on Microsoft Windows, you need to install "X Server" software on the Windows box. You'll want to download and install both Xming and Xming-fonts.


Configuration of sshd and X11

In order for the local X Server (Xming - running on your Windows system) to talk to the remote Linux server, you'll need to verify some settings on the Linux server. First up is configuration of the sshd daemon (typically /etc/ssh/sshd_config for OpenSSH). Look for the following 2 lines and make sure they are configured correctly:

X11Forwarding yes
#X11UseLocalhost yes

By default, OpenSSH ships with X11Forwarding set to "no" but the default for X11UseLocalhost is "yes". So you should only have to add the "X11Forwarding yes" line.

Create a PuTTY session

a PuTTY public-key pair. If you need to install a generated PuTTY key (maybe you want to use a separate PuTTY key for X11 forwarding), then here are the directions for OpenSSH.

(login as yourself or as root and then "su" to your username)
# cd ~/.ssh
# cat > machinename@svn.pub
(paste in PuTTY key)
# ssh-keygen -i -f machinename@svn.pub >> authorized_keys
(Ctrl-D to exit)


1. Right-click on the Pageant icon in the system tray and choose "New Session".
2. Enter the hostname (i.e. 192.168.1.1)
3. Go to the Connection -> SSH -> X11 tab
4. Turn ON "X11 forwarding"
5. Display location should be: localhost:0
6. Go back to the Session tab
7. Enter a name in the Saved Sessions text box (i.e. "MyHost-X11") and click on "Save"
8. Click the "Open" button to connect to the server


If all goes well, you should see a line like:

/usr/bin/xauth: creating new authority file /home/thomas/.Xauthority

Which tells us that SSH is ready to do some X forwarding.

Fire up Xming

If you haven't already ran Xming you should run XLaunch and just roll through the defaults. Now, in the PuTTY window that is sitting at a command prompt, try:

# xeyes

And you should see the xeyes application open up on your Windows system. If you want to continue to start up other X applications, put an ampersand (&) at the end of the line.

More advanced stuff


1. Fire up XLaunch
2. Select "One window" and click "Next"
3. Select "Start a program" and click "Next"
4. The start program should be either "gnome-session" or "startkde"
5. Select Run Remote using PuTTY (plink.exe) and turn on the compression option.
6. Enter the IP address or hostname in "Connect to computer" of the Linux box that you are connecting to
7. Enter your username in the "Login as user"
8. Click the "Next" button
9. In the "Additional parameters", enter "-screen 0 1024 768" which will set screen zero to be 1024x768
10. If you run your SSH server on a non-standard port, enter "-P port" in the PuTTY extra options field (run "plink" at a Windows command prompt to see the possible options)
11. Save your configuration file and click "Finish"

2 comments:

GarykPatton said...

You know so many interesting infomation. You might be very wise. I like such people. Don't top writing.

computer info said...

Thanks for comment

Admin

Hit Counters