There was a problem loading the comments.

Correct the ownership of all accounts in cPanel

Support Portal  »  Knowledgebase  »  Viewing Article

Accidentally changed the ownership of all accounts in cPanel? Here is a simple script which helps you to correct it. This script is intended for cPanel servers only. Furthermore, it is highly recommended that you run a full backup of your server before running this or any other script that makes changes to multiple files. First, you need to create a script file, say “permission. sh”


Add the following script to that file.

cd /var/cpanel/users
for user in *
chown -Rv $user.mail /home/$user/etc
chown -v $user.nobody /home/$user/public_html
chown -Rv $user.$user /home/$user

Give excecution permission

chmod +x

Run the script


That’s it!

Share via

Related Articles

Copyright © 2023 TheGigabit. All right reserved. Reg.No: 200701034297 (792326-P)