Results 1 to 3 of 3

Thread: useradd in wwwroot

  1. #1
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts

    useradd in wwwroot

    How can I acheive this? Specifically I wan't to run a command/bash script/expect script in a PHP file to add a user, ftp/sftp, home dir etc etc, from a user with limited privileges (wwwroot or nobody).


    My initial idea was to use EXPECT, but I couldn't figure out how to pass the required variable parameters from PHP to the EXPECT script for the necessary commands (i.e. su root, useradd, passwd etc).

    Help for any of this would be appreciated.
    To err is human. To really foul things up ... you need a computer.

  2. #2
    Agent of the System ikonia's Avatar
    Join Date
    May 2004
    Location
    South West UK (Bath)
    Posts
    3,736
    Thanks
    39
    Thanked
    75 times in 56 posts
    cgi script with suid (dangerous) permissions.

    so the webserver user calls a script that executes as root.

    You may want to look at securing the cgi script, but thas the most obvious way to me.
    It is Inevitable.....


  3. #3
    Large Member
    Join Date
    Apr 2004
    Posts
    3,720
    Thanks
    47
    Thanked
    99 times in 64 posts
    Don't worry i've figured it out using expect turned out to be a piece of piss and pretty secure too heh.

    Cheers though
    To err is human. To really foul things up ... you need a computer.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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