LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
More on unix permission


Hi,
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:
Code:
# 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
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,359

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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.

http://www.linuxtopia.org/online_boo...5_ch-acls.html
 
Old 02-27-2013, 07:48 PM   #3
shivaa
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:
Code:
# 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):
Code:
drwxr--r-x
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:
Code:
~$ 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.
 
  


Reply

Tags
permissions



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:46 PM.

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