DEV Community

Cover image for SOLVED: Raspberry Pi Permissions
Katie Adams
Katie Adams

Posted on • Edited on

SOLVED: Raspberry Pi Permissions

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

Top comments (7)

Collapse
 
katieadamsdev profile image
Katie Adams

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!!!

Collapse
 
tobiassn profile image
Tobias SN

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

Collapse
 
katieadamsdev profile image
Katie Adams

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

 
katieadamsdev profile image
Katie Adams

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

Some comments may only be visible to logged-in visitors. Sign in to view all comments.