Linux - Newbie This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
05-09-2012, 08:11 AM
|
#1
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
changing the permission of directory.
Hi,
I'm using RHEL 5.3 for web server.
I have to give read and execute permission to all the directories in /home/ who have group ownership of apache.
How would I do that? Can anybody help me?
I would be very thankful!
Regards,
Nitin
|
|
|
05-09-2012, 08:17 AM
|
#2
|
Member
Registered: Jul 2009
Posts: 645
Rep:
|
try
depending on what permissions everyone else must have.(ofcourse you would have added apache group to be the owners of the home directory as well.
Last edited by cbtshare; 05-09-2012 at 08:19 AM.
|
|
|
05-09-2012, 08:22 AM
|
#3
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
cbtshare,
Thank you very much for your promt reply. Thanks very much.
But how would I check that all the directories under /home/ have group ownership of 'apache'?
Regards,
Nitin
|
|
|
05-09-2012, 08:24 AM
|
#4
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Is ls -gl /home/ command is correct to check the group ownership of 'apache' under /home/ directory?
|
|
|
05-09-2012, 08:37 AM
|
#5
|
Member
Registered: Jul 2009
Posts: 645
Rep:
|
you can do that or ,if it is not apache, just do
Quote:
chown -R root.apache /home
|
|
|
|
05-09-2012, 08:45 AM
|
#6
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
No no no, I don't have to give 'apache' ownership to all directories under /home/ directory. I have to only give 'read' and 'execute' premission to all directories under /home directory who have 'apache' ownership.
|
|
|
05-09-2012, 09:02 AM
|
#7
|
Member
Registered: Jul 2009
Posts: 645
Rep:
|
then just ls -l and apply the permissions to the directories you want...its not hard.
|
|
|
05-09-2012, 09:25 AM
|
#8
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Now suppose there are so many directories under /home/arproject/ then, how would I give 'read' and 'execute' permission to all those directories who have group ownership of 'apache'? One bye one it would take long time. Then is there any other method that I can give permissions through one command?
|
|
|
05-09-2012, 11:36 AM
|
#9
|
Senior Member
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,804
|
Quote:
Originally Posted by Nitin Chaudhary
Now suppose there are so many directories under /home/arproject/ then, how would I give 'read' and 'execute' permission to all those directories who have group ownership of 'apache'? One bye one it would take long time. Then is there any other method that I can give permissions through one command?
|
That part is easy:
Code:
find /home/arproject -type d -group apache -exec chmod g+rx {} +
But, note that it is necessary to have at least "execute" permission for every parent directory in the path. For example, if you had a directory "/home/arproject/dir1/apachefiles", group "apache" would need to have "x" permission in /home, /home/arproject, and /home/arproject/dir1 in order to get to the apachefiles directory. If you can't accomplish that with the usual "user", "group", and "other" permissions, you would need to resort to ACLs to give the needed access to group "apache". See `man setfacls` and `man getfacls` for details.
|
|
|
06-13-2012, 03:00 AM
|
#10
|
LQ Newbie
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12
Original Poster
Rep: ![Reputation: Disabled](https://www.linuxquestions.org/questions/images/reputation/reputation_off.gif)
|
Hi,
Ok! Now the problem has been solved. Thanks for your great help. I am marking this thread solved now.
|
|
|
All times are GMT -5. The time now is 03:00 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|