D&C Lug - Home Page
Devon & Cornwall Linux Users' Group

[ Date Index ][ Thread Index ]
[ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] File permissions and access rights



hi there,

check out umask

this command sets which permissions are set on newly created files

#umask 002
means that any new files created will have the permissions you want - i.e. rw rw r


by default it is usually 022 which gives rw r r on new files.


to make it permanent put it into your ~/.bash_profile file - and to apply to all users it should go into the global .bash_rc[?] file which i think is in /etc/ somewhere.


BTW - i think its better practice to create a new group for each user with the same name as the user - this is then set as their primary group - i can't remember why - but it i think it is to do with system accounts or something.


Rick Timmis wrote:


Hello all

Can anyone help me with a little problem on permissions.

I have a group of users, who I put in a group called staff. Each users has staff set as their primary group.

I want all members of staff to have RWX permission for all files in the directory /work

I have set the GID bit on /work and applied this change through the directory so work and its sub contents have the following permission

users RWX
group RWX and GID bit set
other R-X

The directorty is owned by root
and assigned to group staff

so far each users can do exactly as i intended with existing files in the folder. e.g staff 1 writes to file X then the permissions remain unchanged. However when staff 1 creates a new file it becomes readonly to all the other members of the group staff.

Reading through the manual helped me resolve an incorrect primary group setting but i am at a loss as to how to make new files created by group members from being read only to the others.

Newly created files have the following persmissions

user RW
group R
others R

Owner <userid>
Group users

because the GID bit is set on the directory then all files created in that directory will have the same GID as the directory - this is why all the new files have 'users' as the group - which i presume is the intended action.


HTH,

kev


Any offers ??


Thanks RIck


-- The Mailing List for the Devon & Cornwall LUG Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the message body to unsubscribe.




-- The Mailing List for the Devon & Cornwall LUG Mail majordomo@xxxxxxxxxxxx with "unsubscribe list" in the message body to unsubscribe.


Lynx friendly