Running a sudo command through SSH

Sometimes you may want to run a command on a remote machine that requires root level permissions.  This can be done with SSH with the -t flag to force a psuedo tty

ssh -t remote-server '/path/to/command'

Make sure to single quotes are part of your command.  You will be prompted for the user password and then the sudo password.

jhudgins has written 34 articles

Leave a Reply