LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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, 08: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, 08:17 AM   #2
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

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 08:19 AM.
 
Old 05-09-2012, 08: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, 08: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, 08:37 AM   #5
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

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, 08: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, 09:02 AM   #7
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Rep: Reputation: 42
then just ls -l and apply the permissions to the directories you want...its not hard.
 
Old 05-09-2012, 09: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, 11:36 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,120

Rep: Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345Reputation: 1345
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, 03: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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:33 AM
changing home directory permission in user management after user created in suse(KDE) hamedhsn Linux - Security 4 04-06-2011 10:18 PM
Changing Directory Permission tendonut Linux - Software 1 08-19-2007 08:57 PM
Changing File Permission in a FTP directory to prevent deleting of files shawnbishop Linux - Software 3 01-10-2006 06:41 AM
mount -- changing directory permission newbie_jubie Linux - Software 5 02-15-2002 02:06 AM


All times are GMT -5. The time now is 09:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration