Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gabouh/8f316ebae63ab634474f6e01808f82b0 to your computer and use it in GitHub Desktop.
Save gabouh/8f316ebae63ab634474f6e01808f82b0 to your computer and use it in GitHub Desktop.
Fix user permissions to vesta control panel
#!/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