Script to fix user and group permissions?

mzuker

Registered
Apr 24, 2018
2
0
1
chile
cPanel Access Level
Root Administrator
do you have an script to automatically fix user and group permissions in all the server?

by mistake we run a script to upgrade all wordpress and plugins as root user, now root user is the owner of all wordpress and plugins in the server for hundred of accounts.


we didnt fix this yet,
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,917
2,248
363
Hello @mzuker,

We don't provide any scripts that will automatically repair the permission and ownership values. Do you have backups of the accounts? If so, we typically recommend restoring the accounts from backup to address this type of issue. Or, in the event the command was ran for directories outside of /home as well, we recommend moving the existing backups to a remote location, reinstalling the OS/cPanel, and then restoring the accounts from backup.

Thank you.
 

mzuker

Registered
Apr 24, 2018
2
0
1
chile
cPanel Access Level
Root Administrator
i understand, but we have hundred of accounts affected and the backup is on amazon, so dont want to fix them one by one
only need to fix the user and group permission of user accounts files inside public_html so there will not keep some files and folders with root user and group
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,917
2,248
363
Hello,

You may find the user-submitted script on the following thread helpful:

suphp breaking WP sites

However, keep in mind it's unsupported, and it's typically not a good idea to change permission/ownership values recursively because it's possible a file is supposed to have lower permissions or different ownership values.

Thank you.