Re: [Nolug] "automatically" setting file permissions to -rw-rw-rw-

From: Scott Harney <scotth_at_scottharney.com>
Date: Tue, 18 Feb 2003 14:47:10 -0600
Message-ID: <87vfzh71v5.fsf@zenarcade.local.lan>

"T.E.Stirewalt" <TomS@ComputerBrain.net> writes:

Here's what you might want to do.
1) make a group for this directory
  # groupadd mygroup
2) edit /etc/group and add usernames of your users to the group.
   Semantics will be clear when you open the file.
3) change the directory group to mygroup and make it writable by mygroup.
   Additionally make it setgid(man chmod) as well so no matter who makes a file within
   that dir it will have the same group owner. Then fix all the existing files.
 # chgrp -R mygroup /my/shared/dir
 # chmod 2755 /my/shared/dir (could also do 'chmod ug+rwx,o+rx,g+s /my/shared/dir')
 # chmod -R g+w /my/shared/dir
4) set umask in /etc/profile so that files created
   will have group writeable perms. umask should be 002 in this case.
   Note that if the user's own .profile,.bash_profile etc modify umask, this will break
   for those shell users
   samba would be better since you can umask by individual share. something
   like "create mask = 775"(it's not a umask) in the appropriate place in the share
   definition in /etc/smb.conf will make it so that files are created group writable.
   smb.conf sets the create mask to 700 by default. This is the behavior you're seeing.
 

Now when they create files in the dir it will be own by the user but group-owned by
mygroup. additionally, because of the umask, they will be group-writable by the group
as well.

If you really want world-writable then umask is 000.

> I am unabashedly a newbie to any flavor of Linux.
>
> I need some help, information, instructions, something....
>
> I want to 'automatically' set file permissions to -rw-rw-rw- instead of -rw-r--r--
>
> Scenario: On a Linux box... => User01 creates & saves, then exits the program a word
> processing file using OpenOffice and saves it to a shared directory. User02 needs to open
> that same file from User02's machine on the network, do some editing, then save the changes
> to the same filename, close the file and the word processing program used for the edits (say
> for the purposes of this example, it is MSWord2k on a Windows box, but I really don't think
> it matters if it is a samba-share or an NFS-share).
>
> Right now, if User01 creates/saves the file permissions default to -rw-r--r--
> User02 can only open the file as read only, then must save as something else... and THAT
> saved file defaults to -rw-r--r-- for User02, which means User01 can only open it as read
> only, etc. etc. etc.
>
> I want to set the default file permissions so an anyone/everyone who accesses the shared
> resource directory can create, open, edit, and save any file found there.
>
> If possible I don't want to make this default to be 'global' in that it will apply to EVERY
> directory, just to the designated shared directory (directories?).
>
> I have played with UNMASK in etc/profile
> In the particular version of Linux I am currently using (Xandros [debian based]) the line
> in question reads
> unmask 022
> I have tried modifying that to read
> unmask a+rw,a-x
> and restarted the computer. The result is a verrrrry slooooow computer and it does not
> affect the newly created/saved file's permissions. I also (since I do not know what I am
> doing...) tried
> unmask 000
> and restarted the computer. Computer speed is back to normal, but the permissions remain
> unaffected, still default to -rw-r--r-- .
>
> My potential users absolutely will not go the 'extra' step of chmod. They will not even
> 'right click' on the filename and change the permissions from within a GUI. My potential
> users (if I can solve this problem) are non-sophisticated Windows accustomed office workers,
> who know how to start a word processor, create (or open), edit, save, and exit a file. They
> are used to being able to open each other's files and being in a common directory.
>
> I refuse to believe that this problem has not already been solved by the Cobalt Blue Cube
> 'network appliance' people who run some flavor of Linux. It cannot be all that different.
> Unfortunately I lack the necessary experience and vocabulary (jargon?) in Linux to properly
> research the problem.
>
> Any help would be greatly appreciated.
>
> Please remember I am a newbie and basically need key-stroke by key-stroke explanations.
>
> Thanks!
>
> Tom 18 FEB 03
> Thomas E. Stirewalt Jr.
> voice= 504-581-1974 [ans.mach]
> email= TomS@ComputerBrain.net
> www.ComputerBrain.net
>

-- 
Scott Harney<scotth@scottharney.com>
"...and one script to rule them all."
___________________
Nolug mailing list
nolug@nolug.org
Received on 02/18/03

This archive was generated by hypermail 2.2.0 : 12/19/08 EST