LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 05-09-2012, 07:11 AM   #1
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Rep: Reputation: Disabled
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
 
Old 05-09-2012, 07:17 AM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
try
Quote:
chmod -R 760
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 07:19 AM.
 
Old 05-09-2012, 07:22 AM   #3
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
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
 
Old 05-09-2012, 07:24 AM   #4
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Is ls -gl /home/ command is correct to check the group ownership of 'apache' under /home/ directory?
 
Old 05-09-2012, 07:37 AM   #5
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
you can do that or
Quote:
ls -l
,if it is not apache, just do
Quote:
chown -R root.apache /home
 
Old 05-09-2012, 07:45 AM   #6
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-09-2012, 08:02 AM   #7
cbtshare
Member
 
Registered: Jul 2009
Posts: 645

Rep: Reputation: 42
then just ls -l and apply the permissions to the directories you want...its not hard.
 
Old 05-09-2012, 08:25 AM   #8
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
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?
 
Old 05-09-2012, 10:36 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,783

Rep: Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214Reputation: 2214
Quote:
Originally Posted by Nitin Chaudhary View Post
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.
 
Old 06-13-2012, 02:00 AM   #10
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hi,

Ok! Now the problem has been solved. Thanks for your great help. I am marking this thread solved now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing the password of Directory Manager in Redhat Directory Services sudarshan.bisht Linux - Server 2 11-19-2013 04:33 AM
changing home directory permission in user management after user created in suse(KDE) hamedhsn Linux - Security 4 04-06-2011 09:18 PM
Changing Directory Permission tendonut Linux - Software 1 08-19-2007 07:57 PM
Changing File Permission in a FTP directory to prevent deleting of files shawnbishop Linux - Software 3 01-10-2006 05:41 AM
mount -- changing directory permission newbie_jubie Linux - Software 5 02-15-2002 01:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration