Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to shutdown raspberry pi over ssh

I am accessing my raspberry pi 3 from ssh. Can you tell me how to shut it down from ssh. Whenever I use sudo shutdown -h now the terminal just freezes without any output. If I kill the terminal I can ssh into raspberry again showing it did not shut down.

like image 869
freeza Avatar asked Oct 19 '25 20:10

freeza


2 Answers

Add the -P flag:

sudo shutdown -h -P now
like image 139
user6731992 Avatar answered Oct 22 '25 03:10

user6731992


sudo shutdown -h now or sudo halt

You can’t use shutdown (or halt) unless you have sudo privileges.

-h instructs to halt the system, now means to run command right now. You can add a number X to tell it to shut down in X minutes. It also allows a specific time in this format XX:XX (note this is in 24 hour format seperated by a : colon).

like image 24
Silicon Star Avatar answered Oct 22 '25 05:10

Silicon Star



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!