|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
the operating system (Unix) considers a php-server as a user with name "nobody". For example, if my php-script saves a file uploaded by a user, the owner of the file will be "nobody". I would like to know if "nobody" is considered as "group" or "others" (in terms of the "chmod" command)? In other words, is "chmod g+w dirname" sufficient to allow to "nobody" to write in the directory "dirname" or should I use "chmod o+w dirname"? Thank you. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In our last episode,
<eca073b1-308a-436e-9f09-fa0d4c127eb7@j28g2000hsj.googlegroups.com>, the lovely and talented Fro broadcast on comp.lang.php: > Hi, > the operating system (Unix) considers a php-server as a user with name > "nobody". For example, if my php-script saves a file uploaded by a > user, the owner of the file will be "nobody". I would like to know if > "nobody" is considered as "group" or "others" (in terms of the "chmod" > command)? In other words, is "chmod g+w dirname" sufficient to allow > to "nobody" to write in the directory "dirname" or should I use "chmod > o+w dirname"? Usually 'nobody' is the least priviledged user (and is forbidden to login). Thus, 'nobody' is an 'others' and should not be added to any other group. -- Lars Eighner <http://larseighner.com/> usenet@larseighner.com Countdown: 327 days to go. |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Fro a écrit :
> Hi, > > the operating system (Unix) considers a php-server as a user with name > "nobody". For example, if my php-script saves a file uploaded by a > user, the owner of the file will be "nobody". I would like to know if > "nobody" is considered as "group" or "others" (in terms of the "chmod" > command)? In other words, is "chmod g+w dirname" sufficient to allow > to "nobody" to write in the directory "dirname" or should I use "chmod > o+w dirname"? > > Thank you. Usually, "nobody" user is set with "nogroup" group. Those are 2 differents things, "nobody" can't be considered as group, but nobody's group ("nogroup" in my case) can. "nobody" is a user, thus : - if a file does belong to myname:myname, nobody is just an "other" - if it's myname:nogroup, nobody has group access to the file *because* his group is nogroup - and nobody:myname or nobody:nogroup gives him access as the file owner. The very best option to give write access to a folder which rights you can modify then is to chgrp nogroup (or chown myname:nogroup), and then chmod g+w that directory. Thus the owner ("myname") will still have his user access, the webserver (and php) group access , and any other user won't have any access. Hope it's clearer... re-reading myself, I'm not sure :p -- Guillaume |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
Guillaume a écrit :
> Usually, "nobody" user is set with "nogroup" group. My bad btw, it's right that there also are many distribs with nobody:nobody. But the point is still there :p -- Guillaume |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
Fro wrote:
> Hi, > > the operating system (Unix) considers a php-server as a user with name > "nobody". For example, if my php-script saves a file uploaded by a > user, the owner of the file will be "nobody". I would like to know if > "nobody" is considered as "group" or "others" (in terms of the "chmod" > command)? In other words, is "chmod g+w dirname" sufficient to allow > to "nobody" to write in the directory "dirname" or should I use "chmod > o+w dirname"? > > Thank you. > Why aren't you asking this in a Unix newsgroup? It has absolutely nothing to do with PHP. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
![]() |
| Outils de la discussion | |
|
|