Skip to content

Instantly share code, notes, and snippets.

@vanchelo
Created September 8, 2012 08:44
Show Gist options
  • Save vanchelo/3672838 to your computer and use it in GitHub Desktop.
Save vanchelo/3672838 to your computer and use it in GitHub Desktop.
Set right permissions for files of site
#!/bin/bash
dir=/var/www/site
user=userofsite
echo "Set permissions for $dir...";
echo "CHOWN files...";
chown -R $user:$user "$dir";
echo "CHMOD directories...";
find "$dir" -type d -exec chmod 0755 '{}' \;
echo "CHMOD files...";
find "$dir" -type f -exec chmod 0644 '{}' \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment