Find the answer to your Linux question:
Results 1 to 2 of 2
Hi, im fairly new to linux and atm im working on a script to add users from a textfile. Problem is that when i try to log in as one ...
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    2

    Authentication failure.

    Hi, im fairly new to linux and atm im working on a script to add users from a
    textfile. Problem is that when i try to log in as one of the new user i get an
    authentication failure.

    here is the script

    #!/bin/bash

    NEW_USERS="/path to file"
    HOME_BASE="/home/"

    cat ${NEW_USERS} | \
    while read USER PASSWORD GROUP
    do
    useradd -g ${GROUP} -p ${PASSWORD} -m -d ${HOME_BASE}${USER} ${USER}
    done

    text file looks like this.

    name pass group.

    any tips on what could be the problem?

    /Tommy

  2. #2
    drl
    drl is offline
    Linux Engineer drl's Avatar
    Join Date
    Apr 2006
    Location
    Saint Paul, MN, USA / CentOS, Debian, Solaris, SuSE
    Posts
    1,117
    Hi.

    Welcome to the forums.

    Are the passwords the encrypted form?
    Code:
           -p, --password password
                  Encrypted password as returned by crypt(3) for the new  account.
                  The default is to disable the account.
    
    -- excerpt from man useradd
    There may be other issues as well, so I suggest comparing your command with the options in the man page.

    Please use CODE tags when posting data or code.

    Best wishes ... cheers, drl
    Welcome - get the most out of the forum by reading forum basics and guidelines: click here.
    90% of questions can be answered by using man pages, Quick Search, Advanced Search, Google search, Wikipedia.
    We look forward to helping you with the challenge of the other 10%.
    ( Mn, 2.6.n, AMD-64 3000+, ASUS A8V Deluxe, 1 GB, SATA + IDE, Matrox G400 AGP )

Posting Permissions

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