file ownership restoration
Recently I accidently setup ownership of multiple files and folders on my server to that of a particular user with the groupname the same as the user and it has caused some services to fail.
I did manage to make some work again using the fix mailbox permissions utility in whm but what about permissions for the rest of the system?
How can I quickly restore those without entering shell and changing through multiple directories one-by-one and what should the ownership permissions be (user and group)?
-
Hey there! In order to answer this, could you let us know what command was run so we know the scope of the fix that needs to be applied?
0 -
I did a combination of:
chmod user:user *.*
chmod user:user *
chmod user:user .
and I think I even added the -R and -h switches.
I was trying to change ownership of all files and folders within a certain folder including the symbolic links and the references.
For example:
If my folder contained a file named "123", and a symbolic link "456" that pointed to a file "789" in the temp folder outside of the users home folder, then I was trying to update all those with the correct permissions for the user.
But instead, various system files were updated with the user and last night the mail system went down until I manually deleted the exim folder, recreated it with the right user and restarted the service.
Also, what user and group should I set for everything in var/cpanel? I'm guessing in a standard WHM/cpanel installation, files are installed in /scripts and in /var/cpanel. so I somehow have to update those I think.
Also, today I noticed a cosmetic error in only one user account's cpanel which claims that 6 out of 0 domains are used and 5 out of 0 email addresses are used.
0 -
Unfortunately there is no good way to recover from a server-wide "chown -r" - you'll always be finding something in the future that traces back to this issue. The best thing to do in this situation would be to move your backups to a new machine and start fresh.
0
Please sign in to leave a comment.
Comments
3 comments