By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,278 Members | 1,342 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,278 IT Pros & Developers. It's quick & easy.

Does "nobody" is considered as group-member of others?

P: n/a
Fro
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.
Feb 28 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
In our last episode,
<ec**********************************@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/us****@larseighner.com
Countdown: 327 days to go.
Feb 28 '08 #2

P: n/a
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
Feb 28 '08 #3

P: n/a
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
Feb 28 '08 #4

P: n/a
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.
js*******@attglobal.net
==================

Feb 28 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.