Skip to content

Latest commit

 

History

History
11 lines (8 loc) · 388 Bytes

sudo-over-ssh.md

File metadata and controls

11 lines (8 loc) · 388 Bytes

Run sudo commands over ssh

using '-S' flag

The -S (stdin) option causes sudo to read the password from the standard input instead of the terminal device. The password must be followed by a newline character.

The following commands pipes the passwords to the sudo command which takes the password from stdin.

ssh [email protected] 'echo <password> | sudo -S reboot now'