Created
December 4, 2015 19:56
-
-
Save dsiddy/2adac69c6cde811bfc67 to your computer and use it in GitHub Desktop.
secure DreamHost directories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Secure the contents of the given directory recursively. | |
# @see http://wiki.dreamhost.com/Security#Setting_file_permissions | |
if [ -d $1 ]; then | |
find $1 -type f ! -perm +a=x -exec chmod 644 {} + | |
find $1 -type d -exec chmod 755 {} + | |
find $1 -type f -perm +a=x -exec chmod 755 {} + | |
else | |
echo $0: Argument must be a directory. | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment