[HPADM] Re: Problem with below script

From: Ed (ed1901@hotmail.com)
Date: Thu Aug 28 2003 - 05:59:59 EDT


BlankSorry list, this goes directly to the list because the Acxiom.com mailserver is nagging about unknown users ...... Robert, if you haven't been layed off, have them fix the mailserver.

Hello Robert,

Firstly, this script probably won't run on HP-UX because .... it's a Linux script ;) (right?)

Anyway, the Linux man-page says that the -p option takes an encrypted password as an argument as returned by crypt(3). So what happened was that $y was being interpreted as an encrypted password, which is not quite what you intended.

You can check that the lines before ENDPW does get inputed, change the usermod -p bit by cat.

Best regards,
Edward
  ----- Original Message -----
  From: Binkley Robert - rbinkl
  To: Hpux-Admin (E-mail)
  Sent: Tuesday, August 26, 2003 21:11
  Subject: [HPADM] Problem with below script

  for y in `cat list.txt`
  do
    echo $y
    found=`grep $y /etc/passwd`
    if [ -z "$found" ]
    then
      /usr/sbin/useradd -H /home -m -g system -s /bin/ksh $y
      /usr/sbin/usermod -x passwd_min_length=6 $y
      /usr/sbin/usermod -p $y<<ENDPW
  1234five Why dont these lines values get inputed.
  1234five
  ENDPW
      /usr/sbin/usermod -x passwd_min_length=1 passwd_max_length=15 passwd_history_limit=5 $
  y
      /usr/sbin/usermod -x passwd_checked_for_obviousness=1 $y
      /usr/sbin/usermod -x passwd_must_change=1 $y
      /usr/sbin/usermod -x passwd_history_limit=6 $y
      /usr/sbin/usermod -x passwd_expire_time=45 $y
      /usr/sbin/usermod -x max_login_attempts=3 $y
      /usr/sbin/usermod -x administrative_lock_applied=0 $y
    else
      echo "Account for $y exists!"
    fi
  done

  Acxiom
  Robert Lee Binkley Jr.
  301 Industrial Blvd, | Conway | AR 72033 | USA

  Office:501-342-0626 Cell:501-517-2071

  **********************************************************************
  The information contained in this communication is
  confidential, is intended only for the use of the recipient
  named above, and may be legally privileged.
  If the reader of this message is not the intended
  recipient, you are hereby notified that any dissemination,
  distribution, or copying of this communication is strictly
  prohibited.
  If you have received this communication in error,
  please re-send this communication to the sender and
  delete the original message or any copy of it from your
  computer system. Thank You.

--
             ---> Please post QUESTIONS and SUMMARIES only!! <---
        To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
       Name: hpux-admin@dutchworks.nl     Owner: owner-hpux-admin@dutchworks.nl
 
 Archives:  ftp.dutchworks.nl:/pub/digests/hpux-admin       (FTP, browse only)
            http://www.dutchworks.nl/htbin/hpsysadmin   (Web, browse & search)


This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 11:02:33 EDT