PHP running a root system command (mount)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    PHP running a root system command (mount)

    Has anyone done anything that requires PHP to be it's normal user (i.e. apache, and not running as root) but still execute a root level shell command such as mount?

    Solutions so far that has failed to work is:

    "Write a C++ program that will do the mount and execute it with permission rws instead of rwx"

    It still prompts for sudo password. If i'm doing something wrong here, I'll post it in the Linux section, but for now are there any routes to this problem?



    Thanks,




    Dan
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Funnily enough, I'm in the processing of writing a (extension) wrapper for gksu - basically providing a way for PHP to run commands as a super-user.

    I'll get back to you when I'm done.

    Edit: I see that is probably not what you want. Do you want to avoid asking for the password altogether?

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Yes, no password asking.

      I'm in a secure environment and not worried about any internet-facing holes that it may have. I have the freedom to loosen up my leash.

      Let me know how your program goes (especially if it accomplishes my task).

      Thanks n00b ;)



      Dan

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        It may be a possibility - I'll do some playing about with the API, see if it allows you to hardcode the password in. Other than hard-coding it, my plans are of no use to you! :P

        Thanks ... Dan

        Mark (wishes Dan had a sordid past that I knew of!)

        Comment

        Working...