From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5d14ca6c35ee5b90 X-Google-Attributes: gidfee84,public From: erik@pax10f.mipool.uni-jena.de (Erik Braun) Subject: Re: Adding passwords from a script Date: 1998/04/21 Message-ID: #1/1 X-Deja-AN: 346227204 References: <353b7a65.81524045@news3.buffnet.net> Organization: Friedrich-Schiller-University Jena, Germany Newsgroups: comp.unix.osf.osf1 On Fri, 17 Apr 1998 15:51:19 GMT, Jeffrey Sick wrote: >I figured out a way to add hundreds of users at a time to a DEC UNIX >4.0D / C2 server at a time using a script but I can't find a way of >the password being added as well. Does anyone know of a method of >doing this? You may use this Perl subroutine: # $pwd must be the uncrypted password $cryptpwd=crypt($pwd,$salt); sub saltchar { $rc=rand(62); if ($rc<25) { $rc+=65; } # 0-24 goes A-Z elsif ($rc<50) { $rc+=72; } # 25-49 goes a-z else { $rc-=4; } # 50-61 goes ./0-9 $rc; } Hope this helps, Erik -- erik@minet.uni-jena.de