Tuesday, July 2, 2013

Remote shutdown one line ssh command

Q.) How to shut down / restart  a remote linux server from ssh ?



A.)  ssh -t user@hostname 'sudo shutdown -P now'



In the above example

-t  : forces the allocation of a tty for the command.

-P : stands for power off.

-r  : to reboot.

-h : to halt. 



Also all the shutdown arguments can be passed along. To know more about shutdown options run command.

shutdown --help





Baca Juga

Remote shutdown one line ssh command
4/ 5
Oleh
Tampilkan Komentar
Sembunyikan