Group Permissions
#1
Posted 11 November 2004 - 07:40 PM
#2
Posted 11 November 2004 - 08:22 PM
like so...
group1:user1,user2,user3
#3
Posted 11 November 2004 - 10:06 PM
#4
Posted 12 November 2004 - 04:42 AM
#5
Posted 12 November 2004 - 11:50 AM
I think the command is "chown user:group file" but check first !!
#6
Posted 12 November 2004 - 04:36 PM
chgrp is changing group
chmod is for changing permissions
chown -R monkey /home/monkey will change /home/monkey and everything under it to teh owner monkey
chgrp -R bannana /home/monkey will change /home/moneky and everthing under it to the group to banana
chown -R monkey:bannana will change both ownere and group of teh specified diirctory and all under it.
chmod -R 775 /home/monkey will change the permissions of /home/moneky and everthing under it to rwx by owner and group and r by other
chmod o-w will remove other write access
chmod g+x will give execute to the group
and so on.
so you never want to do this...
chmod -R 777 /
#7
Posted 12 November 2004 - 06:42 PM
#8
Posted 12 November 2004 - 07:26 PM
drwxrwx--- monkey bannana /folder1
then anyone who is in group bannana has rwx on the directory as does the owner in this case monkey
I thinks what you are confusing is that it doesn't have to be the users primary group. You can add your users to any group you want them to have access to.
For example I have all my music in a filesystem called /music it's owned by greg the group is music I give my wife read access to it by assign here user to group music and doing a chmod g+r /music
#9
Posted 13 November 2004 - 04:50 AM
Its a little safer if you have multiple users.
#10
Posted 13 November 2004 - 05:09 PM
Its a little safer if you have multiple users.
This is assuming your default umask is set correctly or users don't have the a umask setting in the there profile of 000. How do you take write away from group or read write execute away from other with out teh use of chmod?
let's say I have a 10 users in group users and they all have read on each others files you will need to do a chmod g-r to remove read access to group but the owner still has read write and execute on what they own.
I'm not sure I understand your "world" statement the only way your giving permisions to the world is in the case of chmod 777.
#11
Posted 14 November 2004 - 05:22 AM
Users and groups should be set up to ensure that read and execute permissions are allowed for the group and where needed additional groups with write permissions.
It needs a bit of analysis to tabulate who the users and groups are and what permissions are acceptable for each user and group - if you can't make it work on papaer it won't work in the machine. The rule is work out what you want ( and don't want ) and then implement it. The use of world execute and write permissions should be excluded by sensible analysis.
#12
Posted 14 November 2004 - 04:31 PM
#13
Posted 15 November 2004 - 12:24 PM
As I siad write down your requirements on a piece of paper ( a matrix ) of groups and users and the access each user and/or group of users can be trusted with.
The answer will follow.
#14
Posted 15 November 2004 - 03:57 PM
#16
Posted 15 November 2004 - 06:09 PM
#17
Posted 15 November 2004 - 09:01 PM
A file or dir has three permissions. An owner, a group, and other.
To give someone group access to a folder/file, see above for instructions. The permissions for a folder/file's group parameter is for that group. In this case, everyone who is a member og group1, will have the permissions that you assign to the group parameter of the file/folder. Users that are not the owner, or not in group1 (the group you changed the perms on the file/folder to) then will have "other" permissions.
So, with 774 - owner will have rwx, the members of group (group1) will have rwx, and everyone else (other) will have r.
I hope this explains it. There isnt any correlation between a user's identity, or of what groups they are a member of and the permissions set ona file/folder.
#18
Posted 16 November 2004 - 10:59 AM
Sounds dumb - but at the end permissions will no longer be a mystery !!
#19
Posted 17 November 2004 - 02:54 AM
Sounds dumb - but at the end permissions will no longer be a mystery !!
This is not stupid at all sounds like a good way to just keep banging on it until you get the concept. I did the same thing when I was trying to understand the ln commands. Never for foget about the man pages.
man chown
man chmod
man chgrp.
crazykillers advise is good too. It explains how unix handles groups.
Hope this helps you visualize it a little better.
|d|rwx||rwx||---| monkey bannana /folder1
|d|= directory
the first block |rwx|= owner
the second block |rwx|= group
the last block |---|= other
#20
Posted 17 November 2004 - 05:35 AM
I havent read through the whole post to a tee to see if that may be a possibility, but imagine this:
rwx
where the letters are simply translators for an on (r|w|x) or off(-) state.
With rwx, you would get 111 which in binary is 7.
for r-x you would get 101 which in binary is 5
for rw- you would get 110 which in binary is 6
So, to string the three permissions together (I will use egorgry's example):
|d|rwx||rwx||---| monkey bannana /folder1
It would be:
d | 111 | 111 | 000 |
Which would be "chmod 770 foo"
You see? Sorry if I brought this to a level that may be way to low, but - hey you never know. Right?

Help










