Skip to content

Instantly share code, notes, and snippets.

@dsiddy
Created December 4, 2015 19:56
Show Gist options
  • Save dsiddy/2adac69c6cde811bfc67 to your computer and use it in GitHub Desktop.
Save dsiddy/2adac69c6cde811bfc67 to your computer and use it in GitHub Desktop.
secure DreamHost directories
#!/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