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 04-05-2015, 12:01 PM   #1
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Posts: 151

Rep: Reputation: 16
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:	35
Size:	30.7 KB
ID:	18013  
 
Old 04-05-2015, 12:10 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
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:

Code:
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
veerain
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:

Code:
ls -l /var/www
ls -l /var/www/html
 AND
ls -l /var/www/html/filesyoucantedit
 
Old 04-06-2015, 11:41 AM   #4
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Posts: 151

Original Poster
Rep: Reputation: 16
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:	6
Size:	43.2 KB
ID:	18020  
 
Old 04-06-2015, 11:48 AM   #5
Habitual
LQ Addict
 
Registered: Jan 2011
Location: Youngstown, Ohio
Distribution: LM17.1/Xfce4.11.8
Posts: 7,167
Blog Entries: 10

Rep: Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979Reputation: 1979
Code:
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
kb2tfa
Member
 
Registered: Oct 2006
Location: Philadelphia PA
Posts: 151

Original Poster
Rep: Reputation: 16
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.
Code:
 usermod -g apache ron
usermod: no changes

chgrp -R apache /var/www

chmod -R g+rwx /var/www

logout/login
worked
 
  


Reply

Tags
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... 127.0.0.1. 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


All times are GMT -5. The time now is 10:27 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