Results 1 to 3 of 3

Thread: Calling a bash script from index.html to crearte unix / linux user accounts

  1. #1
    Junior Member
    Join Date
    Jan 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default Calling a bash script from index.html to crearte unix / linux user accounts

    Hi,

    I have a simple page with a text box and a submit button. When i press the button I want to run a small bash script with the value in the text box as input and show the result in web page.

    These are the scripts I use. Happy to get suggested if you have simple ones.

    root@cpaneltest [/usr/local/apache/htdocs/test]# cat index.html
    <!DOCTYPE html>
    <html>
    <body>


    <div align="center" style="margin-top:275px;">
    <form action="ip.php" >
    IP Address: <input type="text" name="ip" />
    <input type="Submit" value="Ping"/>
    </form>
    </div>


    </body>
    </html>
    root@cpaneltest [/usr/local/apache/htdocs/test]#



    root@cpaneltest [/usr/local/apache/htdocs/test]# cat ip.php
    <?php
    $ip = $_GET['ip'];
    #$cmd = .adduser .. $u;
    $cmd = .echo $ip;
    $out = system($cmd);
    ?>
    root@cpaneltest [/usr/local/apache/htdocs/test]#

  2. #2
    Senior Member cfajohnson's Avatar
    Join Date
    May 2009
    Posts
    190
    Thanks
    0
    Thanked 44 Times in 36 Posts
    Rep Power
    9

    Default

    Take a look at Chris Johnson's Test Bed
    Chris F.A. Johnson <http://cfajohnson.com/shell/>
    Shell programmer and author

  3. #3
    Never say die nixcraft's Avatar
    Join Date
    Jan 2005
    Location
    BIOS
    Posts
    4,498
    Thanks
    17
    Thanked 788 Times in 506 Posts
    Rep Power
    10

    Default

    The web server run as apache or www-data or www user. The addusre command need to be run as root user. The only solution is to run adduser using sudo without password which is a huge security risk.
    All [Solved] threads are closed by mods / admin to avoid spam issues. See Howto mark a thread as [Solved]


Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 1st November 2010, 03:43 PM
  2. Replies: 1
    Last Post: 10th January 2010, 09:17 AM
  3. Postfix user accounts
    By mewrei in forum Mail Servers
    Replies: 4
    Last Post: 1st November 2009, 04:39 AM
  4. Replies: 1
    Last Post: 2nd March 2009, 04:02 PM
  5. Replies: 2
    Last Post: 6th June 2008, 12:53 PM

Tags for this Thread

Posting Permissions

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