Skip to main content
deleted 18 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 239

I use the following command:

ssh -t <hostname> 'sudo shutdown --reboot 0 && exit'

Here is what this is doing:

  • It instructs the machine to reboot in the next moment, but not during this command
  • Exits cleanly from SSH
  • Maintains the SSH TTY the entire time so sudo is happy and can execute properly.

Hope that helps.

I use the following command:

ssh -t <hostname> 'sudo shutdown --reboot 0 && exit'

Here is what this is doing:

  • It instructs the machine to reboot in the next moment, but not during this command
  • Exits cleanly from SSH
  • Maintains the SSH TTY the entire time so sudo is happy and can execute properly.

Hope that helps.

I use the following command:

ssh -t <hostname> 'sudo shutdown --reboot 0 && exit'

Here is what this is doing:

  • It instructs the machine to reboot in the next moment, but not during this command
  • Exits cleanly from SSH
  • Maintains the SSH TTY the entire time so sudo is happy and can execute properly.
Source Link
stieg
  • 41
  • 2

I use the following command:

ssh -t <hostname> 'sudo shutdown --reboot 0 && exit'

Here is what this is doing:

  • It instructs the machine to reboot in the next moment, but not during this command
  • Exits cleanly from SSH
  • Maintains the SSH TTY the entire time so sudo is happy and can execute properly.

Hope that helps.