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.
Hi Guys,
i am trying to restrict user access to files by making him belong just to apache group, issued the following command :
usermod ktouati -g apache
i created a test file:
-rw-rwx--- 1 root apache 7 Jun 11 07:38 test
and i can't see why ktouati can access the "test" file, once in it says permission denied.
thank you for any help!
Hi Guys,
i am trying to restrict user access to files by making him belong just to apache group, issued the following command :
usermod ktouati -g apache
i created a test file:
-rw-rwx--- 1 root apache 7 Jun 11 07:38 test
and i can't see why ktouati can access the "test" file, once in it says permission denied.
thank you for any help!
Permissions are:
File type is first bit.
First three positions are for owner rights
Second three positions are for group rights
Third three positions are for others rights.
So owner is root, but ktouati is in the apache group, which has full rights to the file. So opening it isn't a problem. Not sure what you mean by "once in it says permission denied"...what do you mean? What are you doing to test it?
To tell you the truth, you must understand how UNIX file permissions works, first. And it is really too much to type. You can try Evi Nemeth books or "Learn Linux" series DVD, they are very good on explaining this stuff. There are things like sticky bits that play role, also would you like to use a standard unix permission model or extended (they are very different in both design and commands)
In short if user permissions are sufficient, it will ignore all other permissions and so on, but in practice, you really must figure out the way it works because it will affect EVERYTHING you do in Linux.
Also, if you add a user to a group, that user must log out and thern log back in (or use the newgrp command) before the new group membership will be applied to them.
Hi Guys,
thanks for all that suggested solutions, actually i was to ask how to check that a user is added to a group.
but i noticed that Ajay is typing the command in a different way that i did: usermod -g apache <username> i did type like this usermod <username> -g apache.
once i typed the command correctly logged out and back in, it's working, thanks Ajay! and you all! but i'm still wondering is there a command to troubleshoot and see if a user is added to a group?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.