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

From: T.E.Stirewalt <TomS_at_ComputerBrain.net>
Date: Tue, 18 Feb 2003 22:48:20 -0600
Message-ID: <008901c2d7d2$20813d80$9865fea9@hannibal01>

With any luck this MY replies to the suggestions and my questions will come out in a different font (arial narrow) and in blue.

 

I tried all suggestions I knew how to do.

 

Restarted my computer.

 

Did my usual created and save an Open Office Word Processing file, exit file, then look at permissions and.

 

Still no change. Still -rw-r----

 

   I really do appreciate all the effort expended in trying to help me solve this problem.

   Thank you very much.

 

Scott Harney wrote on 18 FEB 03: <scotth@scottharney.com>

Here's what you might want to do.
1) make a group for this directory
 # groupadd mygroup

Done

2) edit /etc/group and add usernames of your users to the group.
 Semantics will be clear when you open the file.

Done

3) change the directory group to mygroup and make it writable by mygroup.

Done

 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.

I don't know how to do this, typing man chmod gave me info on chmod as expected, but 'setgid' was not in what came up on my screen. Will you expand on this a bit?

 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

Done

4) set umask in /etc/profile so that files created
 will have group writeable perms. umask should be 002 in this case.

Done

 Note that if the user's own .profile,.bash_profile etc modify umask, this will break
 for those shell users

I do not know where to find these two files ( .profile & .bash_profile ) - I did not see them in /etc

 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.

oops. also set 'directory mask = 775' to achieve the desired goal.
            I had no such lines in my etc/samba/samba.conf file, so I added them as set forth in the example you appended below, one 'command' per line, using the numbers you suggested, to wit:

            write list = morgan

            read only = no

            create mask = 0775

            directory mask = 0775

 

Here's the commented lines from my (debian) pasted in from smb.conf
; File creation mask is set to 0700 for security reasons. If you want to
 create files with group=rw permissions, set next parameter to 0775.
 create mask = 0700

; Directory creation mask is set to 0700 for security reasons. If you want to
 create dirs. with group=rw permissions, set next parameter to 0775.
 directory mask = 0700

[www]
 comment = web dir
 path = /var/www
 browseable = yes
 writeable = yes
 write list = scotth
 read only = no
 create mask = 0700
 directory mask = 0700
 change the above masks to 775 to make file and directory entries group=rw
 for the /var/www share

 

Tom 18 Feb 03
Thomas E. Stirewalt Jr.
voice= 504-581-1974 [ans.mach]
email= TomS@ComputerBrain.net

___________________
Nolug mailing list
nolug@nolug.org
Received on 02/18/03

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