As you can tell, we’ve decided to write a couple articles on using the command line in OS X. There is so much power available at your finger tips if you can get through the learning process of the unix based environment. For instance, you have the ability to restart any machine from the command line both locally or across any network (internet included). This is great if you find that screensharing or VNC connections are running a bit slow.
To Restart the Server locally
- Type ‘shutdown -r now’
To Restart the Server remotely with ssh.
- ssh -l root server shutdown -r now
The ‘-l ‘ simply tells the server what your login name is, so, in this case it is root. The ‘server ‘ part of the command will be your URL, or IP address of the server. The ‘-r ‘ means you want a reboot. Don’t forget this, because if you do, your machine will be shutdown instead of rebooted. Which means you’d have to leave your desk and turn the thing back on!!! The ‘now ‘ means you want it done this instant.You can also set the time you would like the server to reboot by adding the time to the end of the command in the format ‘hhmm ‘. H for hours, M for minutes.
- ssh -l root server shutdown -r now 1130
There ya go. You no longer have to use a VNC (remote desktop) application to reboot a server. Which in my case is a great thing, considering my vnc-server software tends to freeze up a lot.

















July 23rd, 2008 at 10:26 pm
You can also use the “reboot” command, or you might have to do “sudo reboot” to run it as root.
July 23rd, 2008 at 11:32 pm
that would be the easy way… ;) I tend to do things the difficult way…lol.
July 23rd, 2008 at 11:32 pm
that would be the easy way… ;) I tend to do things the difficult way…lol.
January 14th, 2010 at 1:02 pm
The
ssh -l root serverIPAddrHere reboot -q
will sit there and wait for additional input because the system terminated ungracefully. Enter a semi-colon (type “;” and press return) and it will then indicate that the connection was reset by peer.
July 25th, 2010 at 10:56 pm
I got the latest Mac Mini server, and I just did the reboot the OS via ssh remotely.
But got problem, that the server is up (I can ping it), but there is not any service started, because I can’t ssh, http, mail etc.
So my question is, why the Services do not start after the reboot? should I personally log into the server as Admin before these fundamental services can start?
any info would be much appreciated.