<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Adding 3000 user and setting there password via a script. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543907#M27040</link>
    <description>Troy,&lt;BR /&gt;&lt;BR /&gt;Think you can use : &lt;BR /&gt;(/tmp/file format is already the same, a list&lt;BR /&gt;of user:passwd:and others informations)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt;/tmp/passwd.users &lt;BR /&gt;cp /etc/passwd /tmp/passwd.ORG&lt;BR /&gt;cp /etc/passwd /etc/passwd.ORG&lt;BR /&gt;for i in `cat /tmp/file` &lt;BR /&gt;do &lt;BR /&gt;USER=`echo $i | cut -f1 -d':'` &lt;BR /&gt;PWD=`echo $i | cut -f2 -d':'` &lt;BR /&gt;# You can do the same for others fields (for example home_dir...)&lt;BR /&gt;useradd _u $USER ... # add other parameters&lt;BR /&gt;EPWD=`perl -e 'print crypt("$ARGV[0]","$ARGV[1]") . "\n";' $pwd ue `&lt;BR /&gt;grep "$USER" /tmp/passwd | awk -F':' -vVAR=$EPWD '{print $1:VAR:$2:$3:$4:$5:$6:$7}' &amp;gt;&amp;gt; /tmp/passwd.users &lt;BR /&gt;done &lt;BR /&gt;cat /tmp/passwd.users &amp;gt;&amp;gt; /tmp/passwd.ORG&lt;BR /&gt;&lt;BR /&gt;Now verify if /tmp/passwd.ORG is good&lt;BR /&gt;and copy it to /etc/passwd&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Herve&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Fri, 22 Jun 2001 15:44:50 GMT</pubDate>
    <dc:creator>Herve BRANGIER</dc:creator>
    <dc:date>2001-06-22T15:44:50Z</dc:date>
    <item>
      <title>Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543895#M27028</link>
      <description>I am a new sys admin who is not too fimiliar with scripting.  I am looking for a script the will add 3000 users to the same home directory and will set there password.</description>
      <pubDate>Fri, 22 Jun 2001 12:46:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543895#M27028</guid>
      <dc:creator>Troy Johnson_2</dc:creator>
      <dc:date>2001-06-22T12:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543896#M27029</link>
      <description>Troy,&lt;BR /&gt;&lt;BR /&gt;you may want to use "/usr/sbin/useradd" if you type the command without any option you'll receive a list of options.&lt;BR /&gt; &lt;BR /&gt;If you have a list of users, e.g. form a file you can read in the lines of the file in a while loop. I'll have to lookup the correct syntax....&lt;BR /&gt;&lt;BR /&gt;rainer</description>
      <pubDate>Fri, 22 Jun 2001 12:58:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543896#M27029</guid>
      <dc:creator>rainer doelker</dc:creator>
      <dc:date>2001-06-22T12:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543897#M27030</link>
      <description>Troy,&lt;BR /&gt;&lt;BR /&gt;so if you have a file with a list of users, e.g.&lt;BR /&gt;user1&lt;BR /&gt;user2&lt;BR /&gt;user3&lt;BR /&gt;and it is named users.txt you can start off with you script like:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;# this will setup users from users.txt&lt;BR /&gt;&lt;BR /&gt;N=100&lt;BR /&gt;cat users.txt |while read i&lt;BR /&gt;do&lt;BR /&gt;  N=`expr $N + 1`&lt;BR /&gt;  useradd -u $N -g 20 -s /sbin/false -c generic $i&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;This will create passwd entries for all users from users.txt. They will belong to group 20 (users) and have "no shell" and they will have as description "generic"&lt;BR /&gt;&lt;BR /&gt;hope this helps.&lt;BR /&gt;rainer</description>
      <pubDate>Fri, 22 Jun 2001 13:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543897#M27030</guid>
      <dc:creator>rainer doelker</dc:creator>
      <dc:date>2001-06-22T13:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543898#M27031</link>
      <description>You don't say what the usernames are, but I assume they're in electronic form somewhere, not system generated, so you can copy the names into a file.&lt;BR /&gt;&lt;BR /&gt;Save your passwd and group files, just in case&lt;BR /&gt;&lt;BR /&gt;cp -p /etc/passwd /etc/passwd.good&lt;BR /&gt;cp -p /etc/group /etc/group.good&lt;BR /&gt;&lt;BR /&gt;Add a dummy user, and assign a passwd.  Grab this passwd (make sure it has no metacharacters in it, such as "/$+" etc.)   Let's assume it's abcdefgh&lt;BR /&gt;&lt;BR /&gt;Create a file, say, "/tmp/file", one line per user&lt;BR /&gt;&lt;BR /&gt;cat /tmp/file | while read user ; do&lt;BR /&gt; useradd $user (+ any other options you like)&lt;BR /&gt; sed "s/$user:\*:/$user:abcdefgh:/" &amp;gt; /tmp/passwd&lt;BR /&gt; mv /tmp/passwd /etc/passwd&lt;BR /&gt; passwd -f $user&lt;BR /&gt;done&lt;BR /&gt;chmod 444 /etc/passwd&lt;BR /&gt;&lt;BR /&gt;Check all is OK before logging out.  Any problems, move the saved files back into place&lt;BR /&gt;&lt;BR /&gt;Note - passwd -f forces them to change their password next time they login, by putting ",.." after the password.&lt;BR /&gt;&lt;BR /&gt;Robin.</description>
      <pubDate>Fri, 22 Jun 2001 13:25:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543898#M27031</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-06-22T13:25:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543899#M27032</link>
      <description>I do have a electronic form of a file that has all 3000 user id's.  I know what each id password should be set too.  I DO NOT want to force the users to change there password the next time they login.  Are these scripts still applicable?</description>
      <pubDate>Fri, 22 Jun 2001 13:43:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543899#M27032</guid>
      <dc:creator>Troy Johnson_2</dc:creator>
      <dc:date>2001-06-22T13:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543900#M27033</link>
      <description>I don't think you can assign a password from the passwd command for sure.&lt;BR /&gt;The /etc/passwd password field is one way translation.&lt;BR /&gt;If you add an entry to the password field, you are adding a decripted string, not the password... thank God for that!&lt;BR /&gt;So, I believe the only way is to get the users to set their passwd on first login.&lt;BR /&gt;Unless you set 3000 of them yourself.&lt;BR /&gt;&lt;BR /&gt;Man passwd just to see if you can do it, but I really doubt it.&lt;BR /&gt;&lt;BR /&gt;Bill</description>
      <pubDate>Fri, 22 Jun 2001 13:50:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543900#M27033</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-06-22T13:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543901#M27034</link>
      <description>Robin,&lt;BR /&gt;&lt;BR /&gt;am I understanding it right that you just move the new gernerated file over /etc/passwd?&lt;BR /&gt;&lt;BR /&gt;Did you keep in mind to keep the existing users especially root !&lt;BR /&gt;&lt;BR /&gt;I'd suggest to change the "mv" line to a line like&lt;BR /&gt;cat /tmp/passwd &amp;gt;&amp;gt; /etc/passwd &lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;rainer</description>
      <pubDate>Fri, 22 Jun 2001 13:58:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543901#M27034</guid>
      <dc:creator>rainer doelker</dc:creator>
      <dc:date>2001-06-22T13:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543902#M27035</link>
      <description>rainer - I'm not telling sed to ONLY output the changed line, but output ALL lines, changing the user in question.&lt;BR /&gt;&lt;BR /&gt;troy - are your passwords already encrypted.  If they're not, I'm not sure you can do it through a standard script.&lt;BR /&gt;&lt;BR /&gt;Robin.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jun 2001 14:09:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543902#M27035</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-06-22T14:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543903#M27036</link>
      <description>&lt;BR /&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;If you have old passwd file insert lines in &lt;BR /&gt;new one. If not, I think I know how to do, &lt;BR /&gt;see below...&lt;BR /&gt;&lt;BR /&gt;You can create users like others said and you &lt;BR /&gt;will obtain a /etc/passwd like that :&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;user2000:...:.......:...&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;After you need to change all passwd, and you &lt;BR /&gt;have a file with user and passwd (not crypted)&lt;BR /&gt;like that : &lt;BR /&gt;    user:passwd&lt;BR /&gt;&lt;BR /&gt;So now you need to insert encrypted passwd :&lt;BR /&gt;&lt;BR /&gt;Compile this small program in /tmp :&lt;BR /&gt;  1) copy it in /tmp/cr.c&lt;BR /&gt;  2) cc cr.c -o cr&lt;BR /&gt;&lt;BR /&gt;/* DEBUT PRG */&lt;BR /&gt;#include &lt;CRYPT.H&gt;&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;&lt;BR /&gt;void main (narg, args)&lt;BR /&gt;int narg;&lt;BR /&gt;char ** args;&lt;BR /&gt;{ printf ("%s",crypt (args[1],args[2]));}&lt;BR /&gt;/* FIN PRG */&lt;BR /&gt;&lt;BR /&gt;Now you can use this prg like that :&lt;BR /&gt;&lt;BR /&gt;/tmp/cr passwd key&lt;BR /&gt;&lt;BR /&gt;key is a two letters string (which take place&lt;BR /&gt;at the beginning of encrypted passwd, &lt;BR /&gt;man 3 crypt for more informations)&lt;BR /&gt;&lt;BR /&gt;now a script example (you made a file with &lt;BR /&gt;user:passwd) I use az like key:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt;/tmp/passwd.users&lt;BR /&gt;for i in `cat /tmp/file`&lt;BR /&gt;do&lt;BR /&gt;USER=`echo $i | cut -f1 -d':'`&lt;BR /&gt;PWD=`echo $i | cut -f2 -d':'`&lt;BR /&gt;grep "$USER" /tmp/passwd | awk -F':' -vVAR=`/tmp/cr $PWD az` '{print $1:VAR:$2:$3:$4:$5:$6:$7}' &amp;gt;&amp;gt; /tmp/passwd.users&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Now You need to replace lines in passwd by new&lt;BR /&gt;ones in /tmp/passwd.users&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH &lt;BR /&gt;&lt;BR /&gt;Herve&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/UNISTD.H&gt;&lt;/CRYPT.H&gt;</description>
      <pubDate>Fri, 22 Jun 2001 14:14:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543903#M27036</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-06-22T14:14:26Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543904#M27037</link>
      <description>Troy,&lt;BR /&gt;&lt;BR /&gt;The following perl one-liner can be used for each password, where $pwd is read from your password list, and "ue" is the encryption salt (randomizer).  It doesn't have to be "ue", just any two characters would do.&lt;BR /&gt;&lt;BR /&gt;perl -e 'print crypt("$ARGV[0]","$ARGV[1]") . "\n";' $pwd ue&lt;BR /&gt;&lt;BR /&gt;If you want me to incorporate this into my earlier script, please let me know.&lt;BR /&gt;&lt;BR /&gt;Robin</description>
      <pubDate>Fri, 22 Jun 2001 14:24:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543904#M27037</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-06-22T14:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543905#M27038</link>
      <description>Cool script Herv?!&lt;BR /&gt;You learn something new every day here!&lt;BR /&gt;&lt;BR /&gt;Later,&lt;BR /&gt;Bill</description>
      <pubDate>Fri, 22 Jun 2001 14:44:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543905#M27038</guid>
      <dc:creator>Bill McNAMARA_1</dc:creator>
      <dc:date>2001-06-22T14:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543906#M27039</link>
      <description>Robin,&lt;BR /&gt;No my password list is not encrypted.&lt;BR /&gt;Please incorporate the perl one-liner in your earlier script.</description>
      <pubDate>Fri, 22 Jun 2001 14:50:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543906#M27039</guid>
      <dc:creator>Troy Johnson_2</dc:creator>
      <dc:date>2001-06-22T14:50:52Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543907#M27040</link>
      <description>Troy,&lt;BR /&gt;&lt;BR /&gt;Think you can use : &lt;BR /&gt;(/tmp/file format is already the same, a list&lt;BR /&gt;of user:passwd:and others informations)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;cat &amp;gt;/tmp/passwd.users &lt;BR /&gt;cp /etc/passwd /tmp/passwd.ORG&lt;BR /&gt;cp /etc/passwd /etc/passwd.ORG&lt;BR /&gt;for i in `cat /tmp/file` &lt;BR /&gt;do &lt;BR /&gt;USER=`echo $i | cut -f1 -d':'` &lt;BR /&gt;PWD=`echo $i | cut -f2 -d':'` &lt;BR /&gt;# You can do the same for others fields (for example home_dir...)&lt;BR /&gt;useradd _u $USER ... # add other parameters&lt;BR /&gt;EPWD=`perl -e 'print crypt("$ARGV[0]","$ARGV[1]") . "\n";' $pwd ue `&lt;BR /&gt;grep "$USER" /tmp/passwd | awk -F':' -vVAR=$EPWD '{print $1:VAR:$2:$3:$4:$5:$6:$7}' &amp;gt;&amp;gt; /tmp/passwd.users &lt;BR /&gt;done &lt;BR /&gt;cat /tmp/passwd.users &amp;gt;&amp;gt; /tmp/passwd.ORG&lt;BR /&gt;&lt;BR /&gt;Now verify if /tmp/passwd.ORG is good&lt;BR /&gt;and copy it to /etc/passwd&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;Herve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jun 2001 15:44:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543907#M27040</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-06-22T15:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543908#M27041</link>
      <description>&lt;BR /&gt;Error, in my script I made a copy of Robin's &lt;BR /&gt;Perl command but first parameter is $PWD &lt;BR /&gt;instead of $pwd&lt;BR /&gt;&lt;BR /&gt;Sorry :-(&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 22 Jun 2001 16:13:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543908#M27041</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-06-22T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543909#M27042</link>
      <description>the steps are pretty easy.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&lt;BR /&gt;function getSalt {&lt;BR /&gt;typeset Salts &lt;BR /&gt;typeset -i num&lt;BR /&gt;&lt;BR /&gt;set -A Salts a b c d e f g h i j k l m n o p q r s t u v w x y z     A B C D E F G H I J K L M N O P Q R S T U V W X Y Z     0 1 2 3 4 5 6 7 8 9 . /&lt;BR /&gt;&lt;BR /&gt;num=$(($RANDOM / 512 ))&lt;BR /&gt;salt1=${Salts[$num]}&lt;BR /&gt;&lt;BR /&gt;num=$(($RANDOM / 512 ))&lt;BR /&gt;salt2=${Salts[$num]}&lt;BR /&gt;&lt;BR /&gt;print "$salt1$salt2"&lt;BR /&gt;return&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function encodePwd {&lt;BR /&gt;typeset  pwd="$1" Salt="$2"&lt;BR /&gt;typeset -L8 Pwd&lt;BR /&gt;typeset -i num &lt;BR /&gt;&lt;BR /&gt;num="${#pwd}"&lt;BR /&gt;if [[ $num -gt 7 ]] ;then&lt;BR /&gt; Pwd=$pwd&lt;BR /&gt; pwd=$Pwd&lt;BR /&gt;else&lt;BR /&gt; while (( $num &amp;lt; 8 ))&lt;BR /&gt; do&lt;BR /&gt;  pwd="${pwd}\000"&lt;BR /&gt;  (( num = $num + 1 ))&lt;BR /&gt; done&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;print "${pwd}$Salt" | /usr/lbin/makekey&lt;BR /&gt;&lt;BR /&gt;return&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function editFile {&lt;BR /&gt;&lt;BR /&gt;ex -s $pwdFile &amp;lt;&amp;lt;-EODATA&lt;BR /&gt; /${1}:&lt;BR /&gt; s!:.*:!:${2}:!&lt;BR /&gt; wq&lt;BR /&gt;EODATA&lt;BR /&gt;return&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;cat yourUserAndPasswordFile |&lt;BR /&gt;while read user newPwd&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;# get your salt&lt;BR /&gt;Salt=$(getSalt)&lt;BR /&gt;&lt;BR /&gt;#encode you password&lt;BR /&gt;encodedPwd=$(encodePwd "$newPwd" "$Salt")&lt;BR /&gt;&lt;BR /&gt;#edit your file&lt;BR /&gt;editFile "$user" "$encodedPwd" &amp;gt;/dev/null&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;now this does no validation of appropriate usernames or passwords.  And doesn't support things like trusted systems, NIS, etc.</description>
      <pubDate>Fri, 22 Jun 2001 17:39:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543909#M27042</guid>
      <dc:creator>Curtis Larson_1</dc:creator>
      <dc:date>2001-06-22T17:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543910#M27043</link>
      <description>Troy,&lt;BR /&gt;&lt;BR /&gt;This assumes each line in /tmp/file is of the form:&lt;BR /&gt;&lt;BR /&gt;username password&lt;BR /&gt;&lt;BR /&gt;==============================&lt;BR /&gt;cat /tmp/file | while read user pwd ; do&lt;BR /&gt;useradd $user (+ any other options you like) &lt;BR /&gt;perl -e 'print crypt("$ARGV[0]","$ARGV[1]") . "\n";' $pwd ue | read p&lt;BR /&gt;sed "s/^$user:\*:/$user:$p:/" &amp;gt; /tmp/passwd      &lt;BR /&gt;mv /tmp/passwd /etc/passwd &lt;BR /&gt;passwd -f $user &lt;BR /&gt;done &lt;BR /&gt;chmod 444 /etc/passwd&lt;BR /&gt;==============================&lt;BR /&gt;&lt;BR /&gt;Hope this helps,&lt;BR /&gt;&lt;BR /&gt;Robin.</description>
      <pubDate>Mon, 25 Jun 2001 06:28:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543910#M27043</guid>
      <dc:creator>Robin Wakefield</dc:creator>
      <dc:date>2001-06-25T06:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543911#M27044</link>
      <description>Hi Troy,&lt;BR /&gt;&lt;BR /&gt;It's your first question on this forum... &lt;BR /&gt;&lt;BR /&gt;There is a custom on this forum :when someone &lt;BR /&gt;give you informations (sometimes a solution of &lt;BR /&gt;your problem), it's a good idea to give him &lt;BR /&gt;points...&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Herv?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jun 2001 07:21:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543911#M27044</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-06-25T07:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543912#M27045</link>
      <description>Herve',&lt;BR /&gt;You folks were sending some good stuff at me and needed sometime to apply the scritps.  This call can be closed.&lt;BR /&gt;thanks&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jun 2001 10:45:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543912#M27045</guid>
      <dc:creator>Troy Johnson_2</dc:creator>
      <dc:date>2001-06-25T10:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Adding 3000 user and setting there password via a script.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543913#M27046</link>
      <description>Hi Troy,&lt;BR /&gt;&lt;BR /&gt;I think you success now... Well, could you &lt;BR /&gt;give the community your really tested and &lt;BR /&gt;apply script... For the next one who want to&lt;BR /&gt;do that...&lt;BR /&gt;&lt;BR /&gt;Thanx&lt;BR /&gt;&lt;BR /&gt;Herve&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 25 Jun 2001 11:02:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/adding-3000-user-and-setting-there-password-via-a-script/m-p/2543913#M27046</guid>
      <dc:creator>Herve BRANGIER</dc:creator>
      <dc:date>2001-06-25T11:02:14Z</dc:date>
    </item>
  </channel>
</rss>

