Control Web Panel

WebPanel => CentOS 7 Problems => Topic started by: emar on December 13, 2022, 08:06:15 PM

Title: How to change Owner and Group on a Directory
Post by: emar on December 13, 2022, 08:06:15 PM
Hi,

I tested that fix permissions option, selected a domain name.
It changed/set Owner and Group to "nobody" on some directories.
But I need to change "nobody" to the correct Owner and Group "user1"
Need to set the right Owner and Group for all files and folders in these directories.

(https://snipboard.io/ax5ZGu.jpg)

Any help appreciated..
Title: Re: How to change Owner and Group on a Directory
Post by: overseer on January 08, 2023, 06:55:09 AM
Here's a fun little one-liner you can execute from a root terminal that will reset ownership on all your user directories in /home:
Code: [Select]
for i in $(ls /home); do chown $i:$i /home/$i; done
Title: Re: How to change Owner and Group on a Directory
Post by: emar on January 09, 2023, 04:18:11 AM
@overseer thanks