(Dec 29) New version 0.9.8-18 has been released

[HOWTO] Correct files and folders permissions and ownership

Section with modification and patches for Vesta
Forum rules
Before creating a new topic or reply on the forum you should fill out additional fields "Os" and "Web" in your profile section.
In case of violation, the topic can be closed or response from the support will not be received.
lukapaunovic
Posts: 5
Joined: Sun Dec 03, 2017 6:30 pm

[HOWTO] Correct files and folders permissions and ownership

Postby lukapaunovic » Sun Dec 03, 2017 6:39 pm

To fix files & folders permissions and ownership just run following commands in the shell.
I had a lot of WordPress sites struggling with update/upload so I wrote this.
# Chmod files 0644

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 {} find '{}' -type f -print0 | xargs -0 -I {} chmod 0644 {}; done

# Chown files

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 {} find '{}' -type f -print0 | xargs -0 -I {} chown $i:$i {}; done

# Chmod folders 0755

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 {} find '{}' -type d -print0 | xargs -0 -I {} chmod 0755 {}; done

# Chown folders

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 {} find '{}' -type d -print0 | xargs -0 -I {} chown $i:$i {}; done

Return to “Modification & Patches”



Who is online

Users browsing this forum: No registered users and 1 guest

cron