Web Hosting Talk







View Full Version : chown help


carpman
11-02-2001, 01:04 PM
Hello, as most cpanel users will know there is a bug that means ownership of user dir changes, i have been using chown but i have problem.

If i use:
chown -fR :user1 /home/user1

it works but sets all dir under /home/user1 to user1 which in most cases is required, but certain dir need to have different group ownership ie. mail

which means i then have to do the command again to reset the mail/ dir and any other dir that need resetting by doing

chown -fR :mail /home/user1/mail

is there anyway of excludung a dir?

cheers

Vince
11-02-2001, 06:57 PM
Hey,

You can do the following, but please be aware that it'll break any of your clients programs which require that some of their directories/files are owned by nobody. And Cpanel doesn't work too well with SUExec.

chown -R username:username /home/username
Once you've fixed all of your users' directories, issue the following:
chgrp -R mail /home/*/mail

Vince.

carpman
11-03-2001, 07:42 AM
Thanks but that but i would have changed the ownership with command:
chown -fR :user1 /home/user1
You have highlighted a problem with this command in that it changes all ownerships on all files, which could cause problems with programs that require nobody.

Which bring me back to original question, how can exclude dir from command:
chown -fR :user1 /home/user1

being able to do this would mean i could exclude dir such as /mail and /cgi-bin or other dir that may contain programs that require ownership to be nobody.

thanks


Originally posted by Vince
Hey,

You can do the following, but please be aware that it'll break any of your clients programs which require that some of their directories/files are owned by nobody. And Cpanel doesn't work too well with SUExec.

chown -R username:username /home/username
Once you've fixed all of your users' directories, issue the following:
chgrp -R mail /home/*/mail

Vince.