Skip to content

Instantly share code, notes, and snippets.

@knalli
Created May 2, 2012 20:12
Show Gist options
  • Save knalli/2580025 to your computer and use it in GitHub Desktop.
Save knalli/2580025 to your computer and use it in GitHub Desktop.
Locks a script/binary as preparation for sudo usage
# Removes write access for all users (avoids injecting code)
sudo chmod -w /path/to/your/script
# Transfers the script to root (owned by)
sudo chown root /path/to/your/script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment