Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to copy files to the /var/www folder on Ubuntu 10.04. But I think I don't have the permissions.

How can I do this? Is there some specific permission I should set to this folder?


share|improve this question

migrated from Aug 24 '10 at 12:57

This question came from our site for professional and enthusiast programmers.

Do you have a programming question? – Paul Tomblin Aug 24 '10 at 12:50
These kind of questions are better suited for – Fernando Briano Aug 24 '10 at 12:55

5 Answers 5

up vote 8 down vote accepted

Since /var/www is not owned by your user, you need sudo privileges to do so. From a terminal, you could run:

sudo cp file_you_want_to_copy /var/www
share|improve this answer

You're missing the basics. Take a look here:

Now if you don't want to read everything: If you regularly need to edit files in /var/www, you should consider changing the owner/group and permissions on that directory.

If your username is 'user', try this:

sudo chown user /var/www


sudo chgrp user /var/www
sudo chmod 775 /var/www

Now you can copy a file with: cp file /var/www/

If you just want to copy 1 file without messing with permissions, use:

sudo cp file /var/www/
share|improve this answer

Messing with /var/www directly when you don't have to is such a bad pitfall.

If you have apache, learn about user directories, have a public_html in your home directory and be happy. Web hosting providers are doing this for years.

share|improve this answer
If he did user directories: 1) he would never set his root page 2) he'd have to open up perms in his home dir for the httpd process to read. It's consequences he may not want to do. – Rich Homolka Sep 24 '10 at 15:12

Try using

gksudo nautilus

in the terminal, then navigate to /var/www and you can create, copy or delete files.

share|improve this answer

If gksu is not already installed:

sudo apt-get install gksu

Then do the following:

gksu nautilus /var/www/html

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.