Skip to content

Instantly share code, notes, and snippets.

@turkeryildirim
Created January 21, 2017 21:55
Show Gist options
  • Save turkeryildirim/5b6911d160c2a9afd390bf20165fcaf7 to your computer and use it in GitHub Desktop.
Save turkeryildirim/5b6911d160c2a9afd390bf20165fcaf7 to your computer and use it in GitHub Desktop.
#!/bin/bash
for i in $(ls -d /home/*); do
user=${i/\/home\/}
echo $user
chmod 750 /home/$user/public_html
find /home/$user/public_html/. -type f -exec chmod 640 {} \;
find /home/$user/public_html/. -type d -exec chmod 750 {} \;
chown $user:$user /home/$user/public_html
chown -R $user:$user /home/$user/public_html/*
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment