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?
If you want similar behaviour and even use your normal RDP-client, you could just install xrdp.
For CentOS, it should be sufficient to do
yum install xrdp
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.
You can SSH into the box remotely, and then launch your own VNC session. VNC on Linux works as an entire replacement for an X-server, so multiple users can run multiple VNC sessions, each with their own display workspace.