How to add a user to /etc/passwd using CGI?

Discussion in 'Perl Misc' started by Kempniu, Feb 2, 2004.

  1. Kempniu

    Kempniu Guest

    Hi there,

    I was wondering how do all the "free web space" services etc. work -
    when one fills in a form, he/she is automatically added to the
    system's userlist. How does this work? I mean, how is it possible for
    a CGI script to access /etc/passwd without executing `chmod 666
    /etc/passwd` first? ;)

    And if the users are NOT added to /etc/passwd, then how can they log
    in through FTP (e.g. to upload their websites)?

    Thanks in advance for any kind of explanation,
    Kempniu
     
    Kempniu, Feb 2, 2004
    #1
    1. Advertising

  2. Kempniu

    M Guest


    > I was wondering how do all the "free web space" services etc. work -


    First, this is SO not a perl question it makes my head swim, and should go
    find it's own newsgroup to live out its happy little life.

    > How does this work?


    Second, this question is SO loaded with danger I wouldn't even want to add
    any fuel to the fire.

    my US$0.02

    mike
     
    M, Feb 2, 2004
    #2
    1. Advertising

  3. Kempniu wrote:
    > I was wondering how do all the "free web space" services etc. work -
    > when one fills in a form, he/she is automatically added to the
    > system's userlist. How does this work? I mean, how is it possible for
    > a CGI script to access /etc/passwd without executing `chmod 666
    > /etc/passwd` first? ;)


    You may want to ask in Newsgroup that actually deals with CGI.

    jue
     
    Jürgen Exner, Feb 2, 2004
    #3
  4. Kempniu wrote:
    >
    > Hi there,
    >
    > I was wondering how do all the "free web space" services etc. work -
    > when one fills in a form, he/she is automatically added to the
    > system's userlist. How does this work? I mean, how is it possible for
    > a CGI script to access /etc/passwd without executing `chmod 666
    > /etc/passwd` first? ;)


    What about
    system("useradd",
    "-d /home/$USERNAME",
    "-g freewebusers",
    "-m -k /etc/freeweb.skel",
    "-p $PASSWORD",
    "-s /bin/false",
    $USERNAME);
    ?

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Möllers, Feb 2, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kempniu
    Replies:
    1
    Views:
    546
    Jason A. Crome
    Feb 3, 2004
  2. Robin Cull
    Replies:
    5
    Views:
    419
    Andrew Dalke
    Jul 31, 2003
  3. Marco Herrn
    Replies:
    7
    Views:
    640
    Ng Pheng Siong
    Apr 9, 2004
  4. Iván Cabria
    Replies:
    0
    Views:
    310
    Iván Cabria
    Nov 4, 2004
  5. Steven Hansen

    Etc.passwd on OS X

    Steven Hansen, Oct 13, 2009, in forum: Ruby
    Replies:
    3
    Views:
    149
    Steven Hansen
    Oct 13, 2009
Loading...

Share This Page