Re: File and Folder permissions..
- From: birre <spamtrap@xxxxxxxxxxxx>
- Date: Fri, 14 Jul 2006 13:10:30 +0200
On 2006-07-13 21:49, Whitey Johnson wrote:
I have a 10.1 system at home that my wife and I share. I set up a
directory /home/shared where we can put shared stuff like mp3s or
pictures. I changed the group on the directory to users and set the gid
bit so that all files created in that directory will be with the group
users. Here is my problem. When I put a file in there the user is me the
group is users but the permissions are 644 so she can't delete it or edit
it. I have two solutions neither of which are what I want.
1. i can change the umask for users to 002 in /etc/profile so all files
are created 664. (but then she can see all my pr0n in /home/whitey)
2. I can cron a shell script to "chmod -R 775 /home/shared" every hour.(as
the directory grows this might get to be time and resource consuming and
it sets everything to executable)
Does anyone know how to set a umask for just one directory? I googled, but
found nothing.
Thanks.
If it's possible to delete a file or not depend on the directory permission,
not the file.
If you will make a cronjob that make all files writable for the group, why
making them executable ?
You must think about 2 things.
1. Do not set fixed permissions that may be wrong, use chmod g+w to add write access for the group.
2. Backup (you do backup I hope) ,,, A cronjob that change ctime every hour will tag all files as candidates for incremental backup, only change the files that need to be changed.
The problem are more a single user culture running on a multi user platform.
A file has one owner, and if someone need to change it, just make a copy and change the copy, so your wife now are the owner of her version.
Unix has no locking system that prevent you and your wife to edit the same file,
it's up to you or your application to make sure you don't trash it.
Since you have the gid bit for /home/shared , all new directories will get that
by default, so you don't need and fix for that, but if the umask i 22, you must
add w if you need it.
Do not use chmod -R (never) , use :
find /home/shared ! -perm -g+w -exec chmod g+w {} \;
(add g+w to files that NOT has g+w, do NOT touch other files)
And do chmod go-rwx /home/whitey , since that will stop your wife to access anything there whatever the file permission is,
do as she do with /home/arnold :-)
Someone had the idea that 777 is the ultimate permission, but as example,
you added the gid bit to /home/shared 775 , so now it is 2775 , doing
chmod -R 775 will then remove the gid bit, and if you add +x to files
you can get in trouble.
I have seen a Sun with 20GB memory in a fatal loop, where the last 8 MB
was reserved for a root login so we could do chmod -x on a file, since one user with . first in the $path clicked on a file called "Notes" , with a few 1000 lines of text, and one line had "Notes & <something>" , making 40000 processes something, don't know since I had no time to wait for ps to finish,
but it's very evil to add the x bit to documents. (and have . in the $path)
/birre
.
- Follow-Ups:
- Re: File and Folder permissions..
- From: Whitey Johnson
- Re: File and Folder permissions..
- References:
- File and Folder permissions..
- From: Whitey Johnson
- File and Folder permissions..
- Prev by Date: Re: Suse 10.1
- Next by Date: Re: Houghi..............I found a new newsreader
- Previous by thread: Re: File and Folder permissions..
- Next by thread: Re: File and Folder permissions..
- Index(es):
Relevant Pages
|