Ubuntu – Shutdown over SSH

shutdownsshsudo

I just installed a fresh ubuntu server 12.04. I log in over SSH and use sudo -s to get root access. Then I use shutdown now and the server closes the connection. I cannot access the server over SSH, FTP or HTTP anymore, it appears to be off. But it isn't. The server stays on, without being useful. Why? How can I shutdown the server with SSH?

Best Answer

You can try this command over SSH:

sudo poweroff

If you want to just send this command over SSH and authenticate in one go, append the command to the regular SSH command:

ssh -t <options> <user>@<hostname> sudo poweroff

Thanks muru for suggesting the -t option to allow for entering the sudo password.

Related Question