Share your knowledge at the LQ Wiki.
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-05-2015, 12:01 PM   #1
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Rep: Reputation: 18
Post permission denied editing web files

I am a bit confused and not sure what to look up to fix this issue. When I log in as user, I cannot edit my /var/www/html files.

I have the ownership of /var/www/html set to apache:apache (using centos 7). When I check groups for user it shows user and apache. That does mean I'm apart of the apache group right, and if the /var/www/html is owned by apache, I should be able to edit?
Attached Thumbnails
Click image for larger version

Name:	permissions.png
Views:	38
Size:	30.7 KB
ID:	18013  
Old 04-05-2015, 12:10 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,289

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Sometime only the owner of a file has editing rights (and sometimes no one has write permission -- it depends on how the files' permission is set). Please post the output of:

ls -l /var/www/html
This command will show you the permission of all the files and directories in /var/www/html.

Do you have root access to the system? The root user can edit any file and manipulate its permissions. However, it's not good to do day to day work as root, so you should set the permission of the files you want to edit such that your user account can modify them as needed.
Old 04-05-2015, 12:39 PM   #3
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Give the ouput of:

ls -l /var/www
ls -l /var/www/html
ls -l /var/www/html/filesyoucantedit
Old 04-06-2015, 11:41 AM   #4
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Original Poster
Rep: Reputation: 18
It's owned by root, but I can only create it by being root. I think I need to get a better understanding of permissions.
Attached Thumbnails
Click image for larger version

Name:	permissions-sandbox.png
Views:	8
Size:	43.2 KB
ID:	18020  
Old 04-06-2015, 11:48 AM   #5
LQ Veteran
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
chown apache. /var/www/html -R
and add your self to the apache group, and I'll leave that as an exercise.
Old 04-13-2015, 12:08 PM   #6
Registered: Oct 2006
Location: Philadelphia PA
Distribution: Fedora
Posts: 175

Original Poster
Rep: Reputation: 18
I thought I was already in the apache group. When I displayed "groups ron" my result was "ron : apache" I read that usermod lowercase "g" set primary group while uppercase "G" set secondary group. I'm not quite sure if I have my head around that yet, but this what I did. It appears to work.
 usermod -g apache ron
usermod: no changes

chgrp -R apache /var/www

chmod -R g+rwx /var/www



centos7, permission denied

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
Permission Denied PHP web pages Woogieman Linux - Newbie 10 11-25-2009 10:10 AM
Edit privoxy files directly from the web location... Permission denied. RHLinuxGUY Linux - Networking 4 04-29-2009 09:00 PM
Root denied permission to remove files suse_buse Linux - General 3 10-26-2006 07:56 PM
Permission denied when I try to see the files on my CD ROM riba43 SUSE / openSUSE 10 10-10-2006 03:08 AM
Permission Denied while coping files busaussie Linux - General 5 01-05-2006 12:26 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:28 AM.

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