# ssh user@remotebox "sudo su - user2 -c remotecommand"
gives me the following error:
sudo: sorry, you must have a tty to run sudo
fortunately sudo offers the option -t for a pseudo terminal allocation
and the instruction
# ssh -t user@remotebox "sudo su - user2 -c remotecommand"
now works perfectly
No comments:
Post a Comment