LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-18-2012, 12:04 PM   #1
annec0010
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Rep: Reputation: Disabled
Changing directory and file permissions


Hi All,

I have a Centos box which is hosting a website. I need to change permissions of the home directory (where the website files are)and files.

I need to change the folder permissions to 755 and file permissions to 644. How would I do this?

The main home directory have subfolders and files in those subfolders so I need file and directory permissions changed for everything that is in the home directory.

Any help would be most appreciated.

Chris
 
Old 04-18-2012, 12:18 PM   #2
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,834
Blog Entries: 14

Rep: Reputation: 1081Reputation: 1081Reputation: 1081Reputation: 1081Reputation: 1081Reputation: 1081Reputation: 1081Reputation: 1081
"home directory" has a specific meaning in UNIX/Linux. It is the directory in which a given user lands in on login.

The directory you're talking about would appear to be a "document root" for a web page.

Assuming you're using standard web setup for CentOS (which is derived from RHEL) then the key configuration files for Apache (httpd)web configuration are in /etc/httpd.conf. These aren't the ones you want to change however. These are the ones you want to check for the "document root" location.

To change permissions on a file you simply type: "chmod 755 <directory>" or "chmod 644 <file>" (for the permissions you asked about. Once you find the document root you can do this on those files. However you should be aware web applications are sensitive so it is possible you'd break something by changing permissions. You might want to store existing permissions on everything before making the change so you can restore the permissions if necessary.

Who is asking you to change these permissions? What exactly did they ask you to do?
 
Old 04-18-2012, 01:29 PM   #3
annec0010
LQ Newbie
 
Registered: Dec 2011
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thank you for clarifying those two.

The guys who wrote the website are asking for all directory permissions to be set to 755 and all file permissions to be set to 644. I believe they've written the site using Joomla and I think the reason for those change of permissions is due to issues with the CMS system not working properly from the back end.
 
Old 04-18-2012, 02:16 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Code:
find <path of the home directory> -type d -exec chmod 755 {} \;
find <path of the home directory> -type f -exec chmod 644 {} \;
 
  


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
Problems changing file and directory permissions using chmod southwlm Linux - Newbie 4 03-29-2012 02:57 PM
Permissions denied - changing directory rust8y Solaris / OpenSolaris 1 08-08-2006 07:22 PM
Changing Directory Permissions trevor4706 Fedora 2 06-13-2006 06:37 PM
Changing file permissions within a directory for all files. cajunaggie Linux - Newbie 2 02-06-2005 01:53 AM
Changing directory permissions Bagsy Linux - Newbie 1 07-08-2003 05:50 AM


All times are GMT -5. The time now is 10:13 AM.

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