SOLVED: Raspberry Pi Permissions
Katie Adams

Katie Adams @katieadamsdev

About: Web developer at Greggs, UK with a proficiency in VueJS, Tailwind, and Storyblok, as well as other frameworks. I'm also passionate about web design, and mobile app development.

Location:
Newcastle-upon-Tyne, UK
Joined:
Apr 11, 2019

SOLVED: Raspberry Pi Permissions

Publish Date: May 3 '19
6 7

Hello folks!

I'm looking for some help with a Raspberry Pi project I'm working on.

It's a Raspberry Pi 3 Model B+ running Raspbian and Apache server. Everything to do with Apache is up and running - as in I can see the generatde index.html file and edit it in Geany with the gksudo command.

However, my next step is to set up the rest of the web app within the /var/www/html folder. I cannot seem to do this because of permissions. The folder is owned by root and has a group of root.

I've scoured the web and StackOverflow but can't seem to find any solution that either:
A) is the definitive best practice for security
B) make sense to a Raspbian newbie like me
C) works

I decided to pose my question here. What is a secure way to grant myself editing rights to the /var/www/html folder that doesn't violate security rules? Any sort of explanation that you could offer with regards to what the command is doing too would be very appreciated. I'd like to know what's going on so I can learn from it. XD

Comments 7 total

  • Tobias SN
    Tobias SNMay 3, 2019

    chmod -R +w /var/www/html should do the trick.

    • Katie Adams
      Katie AdamsMay 6, 2019

      Hi there - that was really helpful. For separation of concerns, I paired this with the steps of another answer but this really help :D

  • Katie Adams
    Katie AdamsMay 6, 2019

    This worked! Thank you so much - and your explanation is perfect, exactly what I needed.

    If I might ask you one more question: in that last line, what do the -R g+w parameters do? Everything else I understand.

    You're the best!!!

  • Katie Adams
    Katie AdamsMay 7, 2019

    Ah, I understand now. I cannot thank you enough, Phil. :D

  • pbrysonn
    pbrysonnJul 19, 2020

    I think I am facing a similar problem here. I'm trying to install the pip library in my raspberry pi but it keeps failing. Decided to increase the size in my etc/dphys-swapfile folder but i keep seeing the error message which says operation not permitted. I need help giving permission access to my user pi because it seems all remote access belongs to the user root. I have tried all other possible methods but it won't work

    ANY HELP GUYS???

Add comment