Well there’s a couple of ways to do this.
Ctrl+alt+backspace = Restart X
Or there are alternate routes.
If you can run commands as root you can also run /etc/init.d/gdm /etc/init.d/kdm this is not the same for all distros however. Each distro has it’s own way of doing this. I recommend you figure this one out on your own.