Skip to content

Instantly share code, notes, and snippets.

@s1037989
Last active March 25, 2022 09:30
Show Gist options
  • Save s1037989/83006e40f0cdf482c06bf850f0ba8c7a to your computer and use it in GitHub Desktop.
Save s1037989/83006e40f0cdf482c06bf850f0ba8c7a to your computer and use it in GitHub Desktop.
security log for sudo use
function sudo { local sudo=$(which sudo) what; sudo -v || return; whatis $1 &>/dev/null && what=$(whatis $1 | perl -pE 's/^.*?- //') || while :; do what=$(zenity --entry --title "Sudo Log" --text "What are you doing with \$($*)") && [ ${#what} -ge 5 ] && break; done; echo "Security Log: $what | sudo $*" | logger; $sudo -E $*; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment