Re: File and Folder permissions..



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
.



Relevant Pages

  • RE: Since SP1 install auto backup failing
    ... BackUp is working however 3 complete in a row without any errors is the most ... > Microsoft CSS Online Newsgroup Support ... > This newsgroup only focuses on SBS technical issues. ... >>> permission and the Launch permissions. ...
    (microsoft.public.windows.server.sbs)
  • Re: backup wizzard error
    ... i run the backup wizzard. ... Choose "Customize" under Launch and Activation Permissions. ... > Microsoft CSS Online Newsgroup Support ... > This newsgroup only focuses on SBS technical issues. ...
    (microsoft.public.windows.server.sbs)
  • Re: Folder/File Rights before SBS 2003 Migration
    ... I agree with MCTrainer on this, far easier to make the NT Backup (or your ... favorite software) provide the restore with the correct permissions. ... Performing an SCOPY or an XCOPY ...
    (microsoft.public.windows.server.sbs)
  • Re: Clients overwrite default AD permissions intermittantly
    ... The "shared file array" is our file server storage volume. ... "Backup Domain" is that our backup is performed from a backup server ... I said AD permissions just to be brief. ... Also, other files in that folder will have the "default" permissions, ...
    (comp.os.ms-windows.nt.admin.security)
  • Re: Scripted backups..
    ... I had the File share permissions set correctly and but not the NTFS ... You should also report the contents of your .bks file. ... Active backup destination: File ... assigning the drive letter and I can read the ntbackup files and write ...
    (microsoft.public.windows.server.general)