Logging out someone remotely
If a Mac running OS X appears to be stuck, then unless you have disconnected something inappropriately, it almost certain to be just the display that is frozen, not the system itself. It is almost always possible to log into the computer from another one. Once logged in, if you are an administrator, it is possible to forcibly log out the user or to reboot.
Open a window in Terminal (or in a Windows equivalent like PuTTY then enter:
If asked to accept the computer's identity, enter:
When asked, enter your password.
Next, to log somebody out enter one of these:
Or to reboot the computer enter:
Finally, when asked again, enter your password.