I am rather new to linux and have a CentOS box to play with. I am quite comfortable with the command line, but one thing that bugs me is that unless, someone is logged in to the GUI and has vnc enabled, I can't access it from a remote location. Even then, I must use the GUI as the user that is logged in. What if I wanted to logout and login as a different user in GUI ? Basically what i'm asking is, is there a way to remotely "log in" to a linux gui as done with windows remote desktop as opposed to just desktop sharing via vnc?
You can use the X11 desktop forwarding feature.
To do so, first install the SSH server on the target machine (that will allow encrypted connection; it is possible to do it without SSH, but it's very dangerous as data is sent in clear text) and enable the X11 forwarding in
Now you can initiate a graphical connection to the target machine with the following command:
ssh -X -C username@target_machine_hostname
-C flag is not required, it compresses data to reduce network load. So if you have a lot of bandwidth or slow CPU, you can leave it.