[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: chmod mistake

On (02/11/05 12:49), David Dorward wrote:
> > 2. "find" in my home directory gives 1,300 files. Is there any utility that
> > can be used to adjust their permissions quickly? (I will mostly be
> > recursively setting permissions on directories.)
> Something along the lines of:
> chmod -R 700 ~/
> find ~/ -type f -exec chmod 600 {} \;
> might do what you want.
> (Change all files and directories to be readable, writable and
> executable by owner, then change all files so they are not executable.
> You may wish to let other people read some files).

>From some notes I made on setting up servers, from suggestions from people on
the list:

* Prepare a directory hierarchy for group use, do the following as root:
# chgrp -R $group $dir
# find $dir -type d -print0 | xargs -0 chmod 2770

* (You can use mode 2775, depending on needs for further information see 'man
* chmod' and google on Linux permissions)

# sudo find $dir -type f -print0 | xargs -0 chmod 660
* (likewise, you may also use mode 664...)

* An alternative to the above is:
# sudo find $dir -type f -print0 | xargs -0 chmod g=u,o=-rwx
* This will clear permissions for others and set group permissions to the user
* permissions. This will preserve executable permissions.

You should be able to adapt them to your needs.



www.clivemenzies.co.uk ...
...strategies for business

Reply to: