Let's say that I have a premission sub-directory in /var/www/html.
That permission directory belongs to user, named "apache".
[root@localhost jazzman]# mkdir -p /var/www/html/permission [root@localhost jazzman]# chown apache:apache -Rv /var/www/html/permission changed ownership of `/var/www/html/permission' to apache:apache [jazzman@localhost ~]$ ls -ld /var/www/html/permission/ drwxr-xr-x 2 apache apache 4096 Nov 25 12:42 /var/www/html/permission/
The user, named "apache" has a file in that directory, it's called - index.php
[root@localhost jazzman]# ls -la /var/www/html/permission/index.php -rw-r--r-- 1 apache apache 28 Nov 25 12:42 /var/www/html/permission/index.php
I've changed a permission for group's apache on this directory.
[root@localhost jazzman]# chmod 0770 -Rv /var/www/html/permission/ mode of `/var/www/html/permission/' changed to 0770 (rwxrwx---) mode of `/var/www/html/permission/index.php' changed to 0770 (rwxrwx---) [root@localhost jazzman]# ls -la /var/www/html/permission/ total 12 drwxrwx--- 2 apache apache 4096 Nov 25 12:42 . drwxrwxr-x. 12 root root 4096 Nov 25 12:37 .. -rwxrwx--- 1 apache apache 28 Nov 25 12:42 index.php
Add a new user, named "jazzman" to apache group
[root@localhost jazzman]# usermod -G jazzman apache [root@localhost jazzman]# id apache uid=48(apache) gid=48(apache) groups=48(apache),500(jazzman)
The question is, why jazzman doesn't open the index.php file?
[jazzman@localhost ~]$ cat /var/www/html/permission/index.php cat: /var/www/html/permission/index.php: Permission denied
EDIT: OS CentOS 6.3
Edited by jazzman1, 25 November 2012 - 01:01 PM.












