Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to give myself permissions to /var/www/ however for some reason I am unable to do so. Currently what I'm facing is this:

nick@server1:/var$ ls -l
drwxrwxr-x  5 root wwwusers  232 Mar 15 19:31 www
nick@server1:/var$ groups
nick wwwusers
nick@server1:/var$ mkdir www/trying
mkdir: cannot create directory `www/trying': Permission denied

I am running Ubuntu 10.04 LTS on a VPS and am used to running unix on my own machine so I may be doing something absolutely stupid, but I would like to be able to have the group wwwusers be able to write to www.

share|improve this question

migrated from stackoverflow.com Mar 16 '11 at 22:24

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

1  
Log out and log in again. –  Erik Mar 15 '11 at 19:09
    
@Erik I tried that, it hasn't worked. –  Nick Q. Mar 15 '11 at 19:14
    
@Nick: Is /var mounted readonly or something like that? Can you give us the output of grep var /proc/mounts? –  bmk Mar 15 '11 at 21:31
    
@bmk I received no output when I tried grep var /proc/mounts –  Nick Q. Mar 16 '11 at 7:03
    
Does Ubuntu use SELinux or AppArmor? –  Mark Wagner Mar 16 '11 at 22:40

2 Answers 2

Check that you don't have extended attributes set on the www directory

sudo lsattr /var

check the output for www

----i-------- /var/www

if it contains an i then it is immutable and cannot be changed so you will have to remove it

sudo chattr -i /var/www

There may be other extended attributes set that may affect what you are doing so check out the chattr man page.

share|improve this answer
    
There would have been a + after the perms to indicate extended perms. E.g., drwxrwxr-x+ 5 root wwwusers 232 Mar 15 19:31 www –  Mark Wagner Mar 16 '11 at 23:43
    
@embobo: ls -l gives no indication that there are extended attributes on a file. The + is an indication that the file has an ACL attached to it. –  Iain Mar 17 '11 at 7:48
  1. disk full

  2. lsattr (as mentioned above), then if it has an attr you gotta sudo to chattr it.

  3. mount and look for option mounted "ro" for read - only. (live cd?)

  4. is there something already there named trying? (a file or dir?)

  5. is /var/www a MOUNT POINT? (is there a disk in there,not a dir?) if so,then you might need

  6. Most likely deal, you're default group is nick,not www,so can you make your /etc/passwd entry to be the same groupnumber is www?

  7. Unlikely, are ACLs in effect? Linux ACLs Aug 28, 2008 ... Linux supports POSIX ACLs in the stock 2.6 kernel. Linux implements ACLs based on two POSIX drafts -- 1003.1e and 1003.2c -- even though ... http://www.softpanorama.org/Commercial_linuxes/linux_acl.shtml

share|improve this answer

Your Answer

 
discard

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.