LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permission denied editing web files (https://www.linuxquestions.org/questions/linux-newbie-8/permission-denied-editing-web-files-4175538816/)

kb2tfa 04-05-2015 11:01 AM

permission denied editing web files
 
1 Attachment(s)
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?

btmiller 04-05-2015 11:10 AM

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.

veerain 04-05-2015 11:39 AM

Give the ouput of:

Code:

ls -l /var/www
ls -l /var/www/html
 AND
ls -l /var/www/html/filesyoucantedit


kb2tfa 04-06-2015 10:41 AM

1 Attachment(s)
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.

Habitual 04-06-2015 10:48 AM

Code:

chown apache. /var/www/html -R
and add your self to the apache group, and I'll leave that as an exercise.

kb2tfa 04-13-2015 11:08 AM

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



All times are GMT -5. The time now is 06:11 PM.