Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 04-18-2012, 01:04 PM   #1
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.

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

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
"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, 02:29 PM   #3
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, 03:16 PM   #4
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
find <path of the home directory> -type d -exec chmod 755 {} \;
find <path of the home directory> -type f -exec chmod 644 {} \;


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

All times are GMT -5. The time now is 09:49 PM.

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