user@ubuntu:/var/www$ sudo addgroup webwork
[sudo] password for user:
user@ubuntu:/var/www$ sudo chmod g+s /var/www
user@ubuntu:/var/www$ sudo chown :webwork /var/www
user@ubuntu:/var/www$ ls -l ../www
total 4
-rw-r--r-- 1 root root 177 2011-12-13 15:48 index.html
user@ubuntu:/var/www$ sudo usermod -aG webwork user
user@ubuntu:/var/www$ ls -l ../www
total 4
-rw-r--r-- 1 root root 177 2011-12-13 15:48 index.html
user@ubuntu:/var/www$ ls > t.txt
bash: t.txt: Permission denied
user@ubuntu:/var/www$ uname -n
ubuntu
user@ubuntu:/var/www$ whoami
user
I simply want to create a group of webwork and add the current user of user to this group so that it can modify the folder of \var\www.
Question> Why after running the above statement, the user still have no permission to modify the folder /var/www?
Thank you
// Update -- after logout and login //
user@ubuntu:/var/www$ ls -l
total 4
-rw-r--r-- 1 root root 177 2011-12-13 15:48 index.html
user@ubuntu:/var/www$ ls > t.txt
bash: t.txt: Permission denied
lscommand only shows the permissions of the contents of/var/www. Could you runls -l /varand post the results? – Dennis Dec 13 '11 at 22:51