Skip to content

Instantly share code, notes, and snippets.

@quicklywilliam
Created September 22, 2015 23:58
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save quicklywilliam/848cf5a40d44c8c37b48 to your computer and use it in GitHub Desktop.
Save quicklywilliam/848cf5a40d44c8c37b48 to your computer and use it in GitHub Desktop.
Kudo- Use Knock to run a command as root/sudo
function kudo {
export fullcmd=""
for i in "$@"; do export fullcmd="$fullcmd '${i}'";done
osascript -s so -e "do shell script \"$fullcmd 2>&1\" with administrator privileges"
}
@fritz-fritz
Copy link

example usage?

kudo ssh -L 8080:ftp.remotehost.local:80 user@remotejumpbox.example.com

is there a way to tap into the actual sudo command? (without ruining it that is)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment