Can I connect to a GUI in my server using SSH? Can I then use Remote Desktop to control my server using a GUI? The server is Linux CentOS.
migrated from meta.serverfault.com Jun 7 '11 at 21:32
This question came from our discussion, support, and feature requests site for system administrators and IT professionals.
SSH allows you to use X-forwarding with the -X switch. You'd connect with that switch in the command line, then any GUI tools you execute (except Firefox, without a special switch added to that) will appear on your local machine but will be running on the remote system.
Other options are to run VNC on the Linux system and connect to it with a VNC client (although I'd use SSH to tunnel the connection and keep it encrypted).
CentOS may have a tool built in to enable a remote GUI control like Ubuntu now allows.
As mentioned in other answers, you can use X11 forwarding to accomplish this. If you are running a common Linux distribution on your client, this is as easy as connecting with the -X switch to ssh.
If you are using Windows, each client will require a different configuration to enable X forwarding (In PuTTY, it's Connection -> SSH -> X11 -> Enable X11 forwarding). You will also need an X "server" on your Windows machine (in X terminology, the program runs on the client, the graphics, keyboard and mouse are on the server). I personally recommend Xming for this, which is quite easy to set up.