Thread: Add user without interacting.

  1. #1
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    531

    Add user without interacting.

    Is there any function to change password without verification, when process is run by root.
    Or any way to add user with password, without interacting.

    I want to add user from web interface.
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

  2. #2
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    531

    useradd: unable to lock password file

    That's really true. Another interesting thing is that the confidence o say so easily. But doing is much more complicated.
    Move 20 mins to your ref.. Did not find any turning point to solve the problem. I will be checking your resources with more time.

    Here I'm going to explain more.


    I wanted to make a web interface,
    think signup.cgi is the file which has followgin permission:
    -rwsr-sr-x 1 root nogroup 90908 Dec 15 22:58 signup.cgi

    system("/usr/sbin/useradd -d /home/client/nilu -s /bin/mail-pass -p "Passwd9NEU" nilu");

    I wanted to do this from that cgi file in C.

    Giving error:
    useradd: unable to lock password file

    Can anyone help me to go ahead?
    Last edited by zahid; 12-15-2002 at 11:58 AM.
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

  3. #3
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    Posts
    533
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

  4. #4
    Registered User zahid's Avatar
    Join Date
    Aug 2001
    Posts
    531
    I solved the problem temporarily through a loop (each 5 second) process by root. This is much more secure. Though I don't think security is a problem even if that signup.cgi could do that. Ohh. I need encryption of passwords. char *crypt(const char *key, const char *salt); needs lots of library files.
    [ Never code before desk work ]
    -------------------------------------:-->
    A man who fears Nothing is the man who Loves Nothing
    If you Love Nothing, what joy is there in your life.
    =------------------------------------------------------= - I may be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vector vs. array.
    By matsp in forum C++ Programming
    Replies: 37
    Last Post: 06-23-2008, 12:41 PM
  2. pass error before char
    By bazzano in forum C Programming
    Replies: 3
    Last Post: 03-26-2006, 12:00 PM
  3. Newbie Help: Currency Converter
    By Ashfury in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 01:21 PM
  4. Help needed Please
    By jereland in forum C Programming
    Replies: 9
    Last Post: 03-18-2004, 05:30 AM
  5. ~ User Input script help~
    By indy in forum C Programming
    Replies: 4
    Last Post: 12-02-2003, 06:01 AM