rebooting an OS X machine remotely

Why don't you just use AppleScript to restart the mac.

Code:
$ osascript -e 'tell application "System Events" to restart'

That does the equivilent of the Restart menu item in the Apple menu.
 
Well, I'm not sure what that did. System Events is now running(it wasn't before), but i'm not sure if it's restarting.
 
it doesn't seem to be working. Now System Events is running, but it hasn't restarted. I don't have to confirm a restart or something, do I?
 
I did it from a ssh session with a user already logged in, but the user wasn't prompted for the reboot.

The system just did a normal reboot and came back up. It should be noted though that doing a 'shutdown -r now' for me restarts the box and brings it back up with the auto login completed correctly.
 
well this is crazy. I guess I'll just have to wait until I get back in a few days to figure out what's up with it
 
sudo reboot has always worked for me even when there's no user logged in. For example, my mail server will reboot and it's always sitting at the login prompt with Postfix and QPopper running in the background.
 
What do I have to do to login using ssh? Is there anything I need to turn on? What about hosts or keys? Does anyone mind writing a quick How To in the How To section?

I can't get it to work across two machines.

thx.
j.
 
Back
Top