[arch-general] Understanding permissions
Hi, I'm using lighttpd as http server, and it complains about permissions when I ask for a file on my public_html directory. Using strace on lighty I get: stat("/home/mauricio/public_html", 0x7fffceb2dcb0) = -1 EACCES (Permission denied) However, using ls: ls -ld public_html public_html/index.html drwxr-xr-x 3 mauricio users 4096 2009-04-13 19:41 public_html -rw-r--r-- 1 mauricio users 4075 2009-04-13 19:41 public_html/index.html Since 'r' is there in all users field, should not every user, including 'http' used by lighty, be able to read? Thanks for your help, Maurício
Maurício <briqueabraque@yahoo.com>:
stat("/home/mauricio/public_html", 0x7fffceb2dcb0) = -1 EACCES (Permission denied) Is your ~ r-x for others?
-- Gruß, Johannes Täglich http://blog.hehejo.de und du fühlst dich gut. http://cryptocd.eduforge.org/online_version
Dieter Plaetinck wrote:
On Thu, 16 Apr 2009 14:36:36 +0200 Johannes Held <mail@hehejo.de> wrote:
Maurício <briqueabraque@yahoo.com>:
stat("/home/mauricio/public_html", 0x7fffceb2dcb0) = -1 EACCES (Permission denied) Is your ~ r-x for others?
actually only x is needed to traverse directories.
and, iirc, if the user in question needs to traverse a higher level directory for which they do not have the 'x' bit set, they won't be able to access the lower level directories or any files in them. -kludge
Le Jeudi 16 à 17:45, kludge a écrit :
Dieter Plaetinck wrote:
On Thu, 16 Apr 2009 14:36:36 +0200 Johannes Held <mail@hehejo.de> wrote:
Maurício <briqueabraque@yahoo.com>:
stat("/home/mauricio/public_html", 0x7fffceb2dcb0) = -1 EACCES (Permission denied) Is your ~ r-x for others?
actually only x is needed to traverse directories.
and, iirc, if the user in question needs to traverse a higher level directory for which they do not have the 'x' bit set, they won't be able to access the lower level directories or any files in them.
Well, in this case, the higher directories being / and /home, I guess it can safely be assumed that they are +x for everybody :-). More serioulsy, I find that GNU info files about permissions are rather well done. "info File permissions", assuming info is installed. -- Fred
I'm pretty sure that +x is not set for everybody in home. Just cause you don't want that anybody can see what folder you have. If you want have have a pokemon subfolder of anime, nobody else need to now this. So, for me, +x have not to be set. But doesn't seem to be the case for my home directory... Hopefully, it's my laptop, not a shared computer.
On 16 avr. 09, at 22:21, ludovic coues wrote:
I'm pretty sure that +x is not set for everybody in home. Just cause you don't want that anybody can see what folder you have. If you want have have a pokemon subfolder of anime, nobody else need to now this. So, for me, +x have not to be set.
With the +x right on a folder you only give the right to pass through this directory, not to see the content of this directory $ mkdir foo $ touch foo/test1 $ touch foo/test2 $ ls foo test1 test2 $ chmod a-r foo $ ls foo ls: cannot open directory foo: Permission denied $ echo "Hello" > foo/test1 $ cat foo/test1 Hello
But doesn't seem to be the case for my home directory... Hopefully, it's my laptop, not a shared computer.
-- slubman site: http://www.slubman.info/
On 16 avr. 09, at 22:47, slubman wrote:
On 16 avr. 09, at 22:21, ludovic coues wrote:
I'm pretty sure that +x is not set for everybody in home. Just cause you don't want that anybody can see what folder you have. If you want have have a pokemon subfolder of anime, nobody else need to now this. So, for me, +x have not to be set.
With the +x right on a folder you only give the right to pass through this directory, not to see the content of this directory
$ mkdir foo $ touch foo/test1 $ touch foo/test2
$ ls foo test1 test2
$ chmod a-r foo
$ ls foo ls: cannot open directory foo: Permission denied
$ echo "Hello" > foo/test1 $ cat foo/test1 Hello
I sent the mail before I finished. $ chmod a-x foo $ cat foo/test1 cat: foo/test1: Permission denied $ chmod u+r foo $ ls foo ls: cannot access foo/test2: Permission denied ls: cannot access foo/test1: Permission denied test1 test2
But doesn't seem to be the case for my home directory... Hopefully, it's my laptop, not a shared computer.
-- slubman site: http://www.slubman.info/
-- slubman site: http://www.slubman.info/
I've just tried to ls my home folder from an foo account. Doesn't work. So I was wrong. Need more try and fail learning =p
participants (7)
-
Dieter Plaetinck
-
Frédéric Perrin
-
Johannes Held
-
kludge
-
ludovic coues
-
Maurício
-
slubman