How do I shut down remote and local system from terminal?
7,799
For remote systems, you can do ssh <user>@<ip> sudo -c "shutdown -hf now"
for shutdown or ssh <user>@<ip> sudo -c "shutdown -rf now"
for restart.
For local systems, you can do sudo shutdown -hf now
for shutdown or sudo shutdown -rf now
for restart.
Related videos on Youtube
Author by
user1140237
ConfigureIT The cross-platform application development tools provided, for native iOS and Android apps.See the output of your mobile apps on the fly without compiling using PreviewIT application. http://configure.it/ https://m.configure.it/
Updated on September 18, 2022Comments
-
user1140237 over 1 year
How can I shut down and restart local machine from terminal?
How can I shut down and restart remote systems from terminal. I have remote IP.
-
David Foerster over 8 yearsWelcome to Ask Ubuntu! We're sorry, but Ask Ubuntu is not a forum, but a Question & Answer site: it works best if you ask one question, so you can receive one answer. When you ask multiple questions, you need to find one expert versed in multiple areas, which becomes unlikelier the more questions you put into, well, one question! ;-) So please, split up your question into multiple questions and drop me a comment so I can answer one of your questions.
-
user1140237 over 8 years@DavidFoerster Okay thanks next time will take care.. but i thought both should under same command thts why i asked in same
-
David Foerster over 8 yearsYou generally use different commands to shut down local vs. remote systems, since one needs to establish some communication protocol with remote machines first. Of course, you can access network services on the local machine through the loopback network to shut down the local machine.
-
user1140237 over 8 yearsOkay @DavidFoerster i'll take care next time ... Sorry :) now if you can thn can you please answer if possible than it would be helpful?
-
user1140237 over 8 years@DavidFoerster sorry next time i'll take care and i got the anser
-
Wilhelm Erasmus over 8 years@user1140237 if you got the answer, please mark it as correct or add it as the answer
-
-
user1140237 over 8 years
/bin/bash: shutdown:
command not found -
Wilhelm Erasmus over 8 yearsSorry, should've added you have to be root. Will update answer
-
Wilhelm Erasmus over 8 yearsIs it working better now?
-
user1140237 over 8 years
Permission denied, please try again.
is it because of my server system is not allowing ? -
Wilhelm Erasmus over 8 yearsPossibly yes. If
ssh <user>@<ip>
gives the same output definately. In that case you should open a new question regarding SSH. The gist of it is, if you want to login as root via SSH you need to edit/etc/ssh/sshd_config
to allow root login.