Skip to content

Instantly share code, notes, and snippets.

@murilopontes
Created September 28, 2016 21:48
Show Gist options
  • Save murilopontes/441ff6fcb1a4c5bdc10c073405c5859a to your computer and use it in GitHub Desktop.
Save murilopontes/441ff6fcb1a4c5bdc10c073405c5859a to your computer and use it in GitHub Desktop.
#!/bin/bash
cd /home
chmod 711 *
for x in *; do
echo "fix /home/$x"
groupadd $x &> /dev/null
chown -R $x:$x $x &> /dev/null
chown -R $x:www-data $x/public_html &> /dev/null
chmod -R u+rwX $x &> /dev/null
chmod -R g-rwx $x
chmod -R o-rwx $x
chmod -R g+rwX $x/public_html &> /dev/null
done
chmod 711 *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment