Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello.
I have a directory and want to set different permission on it. For example, "user1" just can Read it and "user2" can Read\Write. Should I use "setfacl"?
Yes, if you have two groups with different permissions and the Other to have no access at all. However, if you can set Other to rx then you will not need setfacl. ACLs complicate maintenance quite a bit.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX
Posts: 1,341
Rep:
Absolutely agree with Turbocapitalist ... I have to use ACLs in several cases and while it does solve the problem, it does indeed complicate things. In certain cases, there is no way around it and you must use ACLs. If at all possible to just go with standard ownership and permission management (user-group-others), stick with that if you can.
Absolutely agree with Turbocapitalist ... I have to use ACLs in several cases and while it does solve the problem, it does indeed complicate things. In certain cases, there is no way around it and you must use ACLs. If at all possible to just go with standard ownership and permission management (user-group-others), stick with that if you can.
The Other category includes any account on the system. If that is no good for you then you'll have to use ACLs to have two groups with different settings.
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX
Posts: 1,341
Rep:
Quote:
Originally Posted by hack3rcon
Can you show me an example?
Sure ... if you mean giving specific permissions to a directory using ACLs ... the command would look something like this (as root) :
Code:
setfacl -R -m "u:hack3rcon:rwx" directoryname
... this would give user "hack3rcon" read-write-execute access (full) to directory "directoryname" and all of its contents (the -R option means recursive ..).
However, the one of the complicated parts comes when you change the contents of the directory after have applied the ACLs ... The new files/subdirectories do not automatically inherit these specific permissions (at least I haven't found a way to do this with ACLs), meaning you have to apply them again ...
However, the one of the complicated parts comes when you change the contents of the directory after have applied the ACLs ... The new files/subdirectories do not automatically inherit these specific permissions (at least I haven't found a way to do this with ACLs), meaning you have to apply them again ...
You can set a default ACL on a directory, and that list does get inherited.
Sure ... if you mean giving specific permissions to a directory using ACLs ... the command would look something like this (as root) :
Code:
setfacl -R -m "u:hack3rcon:rwx" directoryname
... this would give user "hack3rcon" read-write-execute access (full) to directory "directoryname" and all of its contents (the -R option means recursive ..).
However, the one of the complicated parts comes when you change the contents of the directory after have applied the ACLs ... The new files/subdirectories do not automatically inherit these specific permissions (at least I haven't found a way to do this with ACLs), meaning you have to apply them again ...
The Other category includes any account on the system. If that is no good for you then you'll have to use ACLs to have two groups with different settings.
In this example, the "root" user is a member of "agroup" and has "rwx" permission but other members of "agroup" have "rwxs" and other users "rx" ?
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX
Posts: 1,341
Rep:
Quote:
Originally Posted by Edellschwarz
Did this " # setfacl -R -m "u:hack3rcon2:r" directoryname " work for anyone ?
... please keep in mind that in this example from my post, both "hack3rcon" and "directoryname" should be replaced by whichever username and directory one is operating on ... (hence the italics in my post ...).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.