Possible Duplicate:
problems with sudo permissions - /var/lib/sudo owned by uid

I recently installed Ubuntu Server and put the GUI on so I can get the hang of Linux. However, I can't seem to gain access to the /var/www/ folder so I can put and edit my html files...

I tried what was on this post: Change folder permissions and ownership and I still can't move files. (Except if I use nautilus)

When I tried what Ikke suggessted, it appeared to have worked (as in no errors thrown in terminal) but when I still can't move files into the folder.

If I use nautilus and look at the permissions for /var/www it lists me as the owner (is just says my username), Create and Delete files for folder access. And --- for file access. If I change file access to Read and Write it just goes back to --- once I hit Apply Permissions to Enclosed Files.

What am I missing?

marked as duplicate by stephenmyall, Jorge Castro, hhlp, Ringtail, user76204 Dec 6 '12 at 16:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Did you do chmod or just chown? – Karthik T Dec 6 '12 at 5:18
  • I tried both commands. – ecnepsnai Dec 6 '12 at 5:25

/var/www is owned by root. You will need to do the following:

sudo chown user:user /var/www
Where user is your username.

  • I don't know what I'm looking for here. Basically I see: a listing for . a green square for .. and index.html – ecnepsnai Dec 6 '12 at 5:30
  • It might not actually be a symbolic link. I have changed the command above. See if it shows /var/www pointing to another directory. – Simplexion Dec 6 '12 at 5:37
  • This is all I see (for /var and /var/www) imgur - picture – ecnepsnai Dec 6 '12 at 5:46
  • /var/www is owned by root. You will need to do chown. I will edit my answer. – Simplexion Dec 6 '12 at 5:53
  • 1
    I changed the owner, but it did nothing. I still can't move my files into the folder. – ecnepsnai Dec 6 '12 at 5:58

have you tried adding your user to the www-data group?

try this:

sudo usermod -G www-data -a 'your-username-here'

for a little more info you could look here: http://ubuntuforums.org/showthread.php?t=919951

  • I saw that post before I came here, and added myself to www-data, but it didn't do anything. – ecnepsnai Dec 6 '12 at 6:17

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