Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 using this command chown root:www-data /var/www/ -R, but there was a message shown that directory not listed.

share|improve this question
And why did you change it to "root"? – Rinzwind May 5 '13 at 8:55

Once you chown it to owner root and group www-data, in order to access that folder you either have to be the root user, or in the www-data group.

You can add yourself to the www-data group by doing this.

usermod -a -G www-data [your username]

Or you can use sudo to perform any tasks as root.

sudo ls -l /var/www/

Or, if you of course not let root own it at all, which there shouldn't be a reason to.

chown [your username]:www-data /var/www/

share|improve this answer

The right sintax:

sudo chown -R root:www-data /var/www/

Parameter -R have to be first.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.