Results 1 to 7 of 7

Thread: how to understand that a server is running as some user

  1. #1
    Join Date
    Aug 2007
    Beans
    6

    Thumbs up how to understand that a server is running as some user

    Hello, there.

    What does it mean by saying a server is running as some user?

    The server could be a web server, a ftp server and etc.

    Does it mean someone connected with the server have the same rights or permissions on files and directories with the one the server is running as?

    Any help is warmly appreciated.

  2. #2
    Join Date
    Jun 2009
    Beans
    470
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: how to understand that a server is running as some user

    Hmm, what are you talking about ?

  3. #3
    Join Date
    Jun 2009
    Location
    Indiana
    Beans
    83
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: how to understand that a server is running as some user

    When a user connects to a server it is different on how the user's account will react in comparison to the user actually running the server.

    Just because someone has access or credentials to login to a server doesn't mean that they can run or do anything they please.

    Most servers are setup in such a way that each user has extremely limited capabilities, maybe being able to write in a certain directory, or just reading a directory.

    Hope this helps a little bit.
    =========================================

    We are drowning in information, but starved for knowledge....

  4. #4
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,294
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to understand that a server is running as some user

    Quote Originally Posted by hedonplay View Post
    Does it mean someone connected with the server have the same rights or permissions on files and directories with the one the server is running as?
    No, it is the server itself that has those rights. Remember that a server is a program like any other, so it's like when yu run nano, for example. In that case, nano will only be able to write to files that are writable by you, because it is running with your privileges. Likewise, when you say for example that Apache is running "as the www-data user" (which should be the case on Ubuntu), it means that Apache will be able to write to any file that is writable by the www-data user. It does not mean, however, that anyone can just connect to your web server and write to those files, because Apache is not a text editor like nano, it does not just give users a text field and a "Save" button. Apache is a web server, so what it does is... serving web pages. Of course, those web pages can be PHP scripts who tell Apache to write to a file, and if it is told so, it will do it. So it all boils down to this: Apache will not write to files (except log files, of course) unless a script tells it to. And if you have no such script on your server, then it won't.
    「明後日の夕方には帰ってるからね。」


  5. #5
    Join Date
    Aug 2007
    Beans
    6

    Re: how to understand that a server is running as some user

    Quote Originally Posted by dragos2 View Post
    Hmm, what are you talking about ?
    Hi, drogos2,
    I am sorry not to make my question understood, have you get a clearer idea after reading the others' replies?

  6. #6
    Join Date
    Aug 2007
    Beans
    6

    Re: how to understand that a server is running as some user

    Quote Originally Posted by HymnToLife View Post
    Apache will not write to files (except log files, of course) unless a script tells it to.
    I like this sentence!

    Rbishop, HymnTolife, Thanks very much for taking time answering my question so patiently.

    If there is a file called do_something.php in the root directory of www.example.com, when a visitor(no matter who) sends a request like http://www.example.com/do_something.php, the apache server will not take actions unless this file is set to be executable by the server. And if do_something.php need the visitor to be loged in to really do something, then it will tell the server to require something from the visitor.

    Am I right?

  7. #7
    Join Date
    Nov 2005
    Location
    Bordeaux, France
    Beans
    11,294
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: how to understand that a server is running as some user

    Quote Originally Posted by hedonplay View Post
    If there is a file called do_something.php in the root directory of www.example.com, when a visitor(no matter who) sends a request like http://www.example.com/do_something.php, the apache server will not take actions unless this file is set to be executable by the server.
    Be careful. Setting the execute bits at 0 (by using chmod -x for example) on a PHP script will not make it unexecutable by Apache. The execute bit determines if you are permitted to execute the script from a shell, it has no effect on whether Apache can execute it or not.

    Code:
    firas@itsuki ~ % ls -l /home/www/itsuki.fkraiem.org/system.php
    -rw-r-----  1 firas  www  3893 12 Jul  2008 /home/www/itsuki.fkraiem.org/system.php
    Still the script works: http://itsuki.fkraiem.org/system.php

    Quote Originally Posted by hedonplay View Post
    And if do_something.php need the visitor to be loged in to really do something, then it will tell the server to require something from the visitor.

    Am I right?
    Yes.
    「明後日の夕方には帰ってるからね。」


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •