One-shot: connects a session, runs a command under sudo, and closes the session.
Credential reuse: sudoPassword defaults to password from the connect options - the
common case where the login user's password is also their sudo password. Override it when
the sudo password differs, or when you authenticate by key and must still supply a sudo
password. If neither sudoPassword nor password is set, throws.
Same caveats as sudo: the credential-reuse default only makes sense when the SSH
login password is also the sudo password; the remote sudoers policy must allow password
sudo without a tty; command is interpreted by the remote shell.
One-shot: connects a session, runs a command under
sudo, and closes the session.Credential reuse:
sudoPassworddefaults topasswordfrom the connect options - the common case where the login user's password is also their sudo password. Override it when the sudo password differs, or when you authenticate by key and must still supply a sudo password. If neithersudoPasswordnorpasswordis set, throws.Same caveats as sudo: the credential-reuse default only makes sense when the SSH login password is also the sudo password; the remote sudoers policy must allow password sudo without a tty;
commandis interpreted by the remote shell.