Page 1 of 1

[HOWTO] Correct files and folders permissions and ownership

Posted: Sun Dec 03, 2017 6:39 pm
by lukapaunovic
This script will correct file ownership and permissions for all VestaCP hosted websites.
It will set correct permissions for each user account.

Code: Select all

bash <(curl -s https://gist.githubusercontent.com/lukapaunovic/a773ad1fe49a477f4a7717a875d839d7/raw/3bb8c57a4c605d3e598cd97b669293fd18fd8c02/v-fix-websites-permissions)
If you are using PHP-FPM I recommend running this afterwards:

Code: Select all

for i in `/usr/local/vesta/bin/v-list-sys-users | awk '{if(NR>2)print}'`; do find /home/$i/web/ -name 'public_*html' -type d -print0 | xargs -0 -I {} chown $i:nginx {}; done