Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
sudo bash -l is handy if you need root for a bit. – Sirex Sep 2 '10 at 10:05
@Sirex: ...or sudo -s – grawity Sep 2 '10 at 20:08
@grawity. Thats my thing learnt for the day then ;-) – Sirex Sep 3 '10 at 7:07
up vote 4 down vote accepted

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.

share|improve this answer

You must log in to answer this question.

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