How do I change user rights for speciffic users?
I have several users on a linux machine. I want them to have the combination I see fit for certain files REGARDLESS of what or who owns them.
For example, if I have the users alpha, beta and gamma on a machine and the file test owned (for exemple) by alpha, I want it to be able to give every single user a combination of rights of my choosing like in this example: alpha rwx beta r-- gamma --x although beta or gamma do not own the file. Please tell me how to do this recursively on a directory with lots of files inside it. And please tell me how to do the same thing with groups. |
The traditional UNIX and Linux way of controlling group access is with groups. It's true that they don't have quite the level of micromanagement that you describe because the UNIX/Linux world comes from less of a micromanagement way of thinking than some other OSes.
Implementing the group control is fairly straightforward. Create a new group, let's name it greek since the users have greek usernames, and add those users to the group. Code:
groupadd greek Code:
chgrp -R greek /some/path But, alas, you are posting from Windows7 with a question that plays to a Windows strength, perhaps for the purpose of showing that Windows has some virtue after all. And many would argue that ACLs are a valuable feature that Windows has had for a while. But Linux does have ACLs now. I have no reason to use them, but I think they will let you do what you describe. There's a chacl command that also has a -r switch for recursion. See man chacl for help. |
You maybe interested about ACL:
Code:
setfacl -m u:alfa:rwx,u:beta:r,u:gamma:x /path/to/file/test |
I think I have ext3 on my machine so chacl or setfacl won't work (I tried, they did not).
Anyway, you're telling me that I'm bound by the bureaucracy of assigning users to groups, then changing the group owners for all the files then changing the rights with chmod g=--x (for example) and repeating this procedure for every user? Group implementation may be a nice addition to linux, but it shouldn't force root to deal with it. Root should force linux to do whatever it wants (including not dealing with groups). What I mean: Isn't there a command like this: <command> [username/userid] [rights] [files_in_question] that changes the rights for the files in question only for the mentioned users? |
It is supported for ext2, ext3 and raiserfs also. You can manually enable this by adding "acl" option to mount command or fstab.
Quote:
|
Finally I solved it!!!! The solution sounds like this:
1: make sure you have acl installed; if not, Code:
apt-get install acl 2: find out the partition you want acl active on (it's found on /dev/ and it has the form hda1, hda2, sda1, sda2) and mount acl on it using this command: Code:
mount -o remount,acl /dev/hda6 And that worked for me. The command setfacl does what I wanted to achieve and getfacl makes sure it worked. I wrote that so future google wanderers might get intel faster. Further reference: http://www.debianhelp.co.uk/acl.htm |
All times are GMT -5. The time now is 02:44 AM. |