0

I was getting sick of having to sudo every command in my web development folder (/var/www) so I tried to change the permissions to 777. The function seemingly worked (that is, gave no error), although I still wasn't able to edit any of the documents without root access.

Anyway, this isn't really a problem, I just thought I'd give it a shot. The trouble is, now, when I direct my browser to localhost, I get a 403. I presume it has to do with my modifying permissions, although, having changed it to 777, I can't see what permissions it could be lacking. Have I perhaps changed the owner or something similar?

Thanks in advance for any help.

3
  • sudo bash -l is handy if you need root for a bit.
    – Sirex
    Sep 2, 2010 at 10:05
  • @Sirex: ...or sudo -s Sep 2, 2010 at 20:08
  • @grawity. Thats my thing learnt for the day then ;-)
    – Sirex
    Sep 3, 2010 at 7:07

1 Answer 1

4

Depending on which distribution of Linux/Unix/BSD you use, your web server may feel that 777 is too insecure for the open web and refuse to serve pages because the permissions are set too liberally. If your /var/www/ folder is writable to anyone someone could just hijack your server, and your apache (or whatever web server you use) ist trying to protect you from that.

Try resetting permissions to the minimum that is needed to operate. You may want to su to the user you need to be (su - www for example) so you don't need to sudo everything, or you can sudo yourself a whole shell as Sirex suggests.

If your web server is running as root now you may also want to give it a user of its own. If it doesn't need to be root, don't let it be root -- for security's sake.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .