Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-27-2013, 01:16 PM   #1
LQ Newbie
Registered: Jul 2009
Location: Poland
Distribution: openSUSE, Debian
Posts: 15

Rep: Reputation: 0
More on unix permission

I read some articles about permissions, but I think my knowledge is still superficial. Today I went to my website, but nginx told me that page is unavailable (permission denied). Before everything worked well. I remember that only thing what I change was to add 'www-data' user to 'coolmax' group. I made some tests with directories and this is what I found:
# ls -la / |grep qwer
drwxr--r-x   2 coolmax coolmax  4096 2013-02-27 19:06 qwer
# id -nG www-data
www-data cooolmax
# su - www-data
$ ls -la /qwer
ls: cannot access /qwer/.: Permission denied
ls: cannot access /qwer/..: Permission denied
total 0
d????????? ? ? ? ?            ? .
d????????? ? ? ? ?            ? ..
$ exit
# usermod -G www-data www-data
# su - www-data
$ ls -la /qwer
total 8
drwxr--r-x  2 coolmax coolmax 4096 Feb 27 19:50 .
drwxr-xr-x 23 root    root    4096 Feb 27 19:50 ..
Distro is Debian 6.0.5. I know that no 'x' for group is nonsense, when there is 'x' for other users. So I think, when user belongs to group, which directory is set to, then 'other' permissions aren't taken into account. But why's that? I'd very appreciate, if someone could explain it or give me some links.
Old 02-27-2013, 06:41 PM   #2
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,396

Rep: Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395Reputation: 2395
Basically, it checks all the perms, looking for a way to do what's required. I don't know if it goes left-to-right or reverse, but the effect is the same. It keeps going till it gets what it needs or runs out of perms to check.
See also ACLs.
Old 02-27-2013, 07:48 PM   #3
Senior Member
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
The problem is with this:
# ls -la / | grep qwer
drwxr--r-x   2 coolmax coolmax  4096 2013-02-27 19:06 qwer
Directory 'qwer' has no write or execute permission for group members. See this part (marked in Red):
And since 'coolmax' is a supplimentry group for user 'www-data', so he cannot write or execute the directory i.e. cannot see it's content.

So simply solution to this problem is to add at least execute permission for group on qwer directory, as:
~$ chmod -R g+wx qwer
Either user 'www-data' should be member of 'coolmax' group and 'qwer' dir. should have write/execute permission of group OR, 'qwer' directory shold have all permissions for others.

Last edited by shivaa; 02-27-2013 at 07:49 PM.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
samba: forward permission bits to unix/linux clients cdex Linux - Server 3 07-09-2010 03:37 PM
DISCUSSION: Setting File and Directory Permission in Unix/Linux munawer_hassan LinuxAnswers Discussion 1 03-23-2010 11:40 AM
LXer: Unix - System VI Release Notes - More Linux and Unix Humor LXer Syndicated Linux News 0 12-06-2008 03:30 PM
How do add user permission to ~/.ICEauthority or /tmp/.ICE-unix ?? NightSky Linux - Software 3 03-18-2008 05:56 PM
Issues with UNIX Local Sockets permission ghoughto Programming 2 12-13-2004 06:38 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration