Forked from 0x00dec0de/vesta-user-fix-permission.sh
Created
October 11, 2017 21:14
-
-
Save gabouh/8f316ebae63ab634474f6e01808f82b0 to your computer and use it in GitHub Desktop.
Fix user permissions to vesta control panel
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 | |
cd /home/ | |
for i in `ls | grep -v 'lost+found'`; do | |
if id "$i" &>/dev/null ; then | |
chattr -i /home/$i/conf | |
chown -R ${i}:${i} $i | |
chown root:root /home/$i/conf | |
chown root:root /home/$i/conf/* | |
chown root:bind /home/$i/conf/dns/* &>/dev/null | |
chown Debian-exim:mail /home/$i/conf/mail/* &>/dev/null | |
chown dovecot:mail /home/$i/conf/mail/*/passwd &>/dev/null | |
chown root:$i /home/$i/conf/web/* &>/dev/null | |
chattr +i /home/$i/conf | |
echo $i done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment