Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question already has an answer here:

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?

share|improve this question

marked as duplicate by Eliah Kagan, qbi, Luis Alvarado, Raja, Seth Feb 7 '13 at 19:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

Possible dulpicate of… – Kevin Bowen Feb 4 '13 at 9:51
no, rebooting does work – Camil Staps Feb 4 '13 at 10:05
I don't think this issue has anything to do with SSH. It just seems stuck in the shutdown procedure somewhere, or, the ACPI command isn't perfoming an actual power off (just a halt). Do you have physical access to a console of that server to clarify? (or remote-KVM, serial console, etc.) Oh, and have you tried adding the -h flag to shutdown like this? shutdown -h now – gertvdijk Feb 4 '13 at 10:36
It shouldn't be stuck, it's a clean installation with only LAMP installed. shutdown -h now works (as does poweroff, mentioned in the first answer) – Camil Staps Feb 5 '13 at 9:30
up vote 8 down vote accepted

You can try this command over SSH:

sudo poweroff
share|improve this answer
Also you can specify password: ssh user@host 'echo password | sudo -S poweroff' – dds Feb 4 '13 at 11:10
It's generally not a good idea to specify passwords in commands like that (plain text). I've removed the SSH part from your question as the poweroff part is what it is about (and a good suggestion). Removed my earlier comment crititizing that now. +1 – gertvdijk Feb 4 '13 at 11:16

Not the answer you're looking for? Browse other questions tagged or ask your own question.