Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* Adding passwords from a script
@ 1998-04-17  4:00 Jeffrey Sick
  1998-04-18  4:00 ` Nikola Milutinovic
  1998-04-21  4:00 ` Erik Braun
  0 siblings, 2 replies; 4+ messages in thread
From: Jeffrey Sick @ 1998-04-17  4:00 UTC (permalink / raw)



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?

Thanks,
Jeff

wolfanger@wolfcrews.com
http://www.wolfcrews.com




Jeffrey James Wolfanger Sick
VROC #207
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Buffalo State College
Systems Programmer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.wolfcrews.com
Home of The Wonderland Tarot 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding passwords from a script
  1998-04-17  4:00 Adding passwords from a script Jeffrey Sick
@ 1998-04-18  4:00 ` Nikola Milutinovic
  1998-04-21  4:00 ` Erik Braun
  1 sibling, 0 replies; 4+ messages in thread
From: Nikola Milutinovic @ 1998-04-18  4:00 UTC (permalink / raw)



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 are adding them without "adduser" command? Like using edauth
command?

Well, why not give them passwords with "passwd"? Look below.

-------------------------------------

#!/usr/bin/zsh

UNAME=$1
UPASS=$2

passwd $UNAME << END_OF_PASS
p
$UPASS
$UPASS
END_OF_PASS

-------------------------------------

That should do it. The other alternative is C programming, which you
don't wanna do.

BTW, what other steps, aside from "edauth", (or whatever) are you taking
to insure the consistancy of the C2 databases?

CU,
Nix.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding passwords from a script
  1998-04-17  4:00 Adding passwords from a script Jeffrey Sick
  1998-04-18  4:00 ` Nikola Milutinovic
@ 1998-04-21  4:00 ` Erik Braun
  1998-04-21  4:00   ` Erik Braun
  1 sibling, 1 reply; 4+ messages in thread
From: Erik Braun @ 1998-04-21  4:00 UTC (permalink / raw)



On Fri, 17 Apr 1998 15:51:19 GMT, Jeffrey Sick <wolfanger@wolfcrews.com> 
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



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Adding passwords from a script
  1998-04-21  4:00 ` Erik Braun
@ 1998-04-21  4:00   ` Erik Braun
  0 siblings, 0 replies; 4+ messages in thread
From: Erik Braun @ 1998-04-21  4:00 UTC (permalink / raw)



I forgot one line, sorry:


># $pwd must be the uncrypted password
>

$salt=&saltchar+&saltchar;

>$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;
>}

-- 
erik@minet.uni-jena.de



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-04-21  4:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-04-17  4:00 Adding passwords from a script Jeffrey Sick
1998-04-18  4:00 ` Nikola Milutinovic
1998-04-21  4:00 ` Erik Braun
1998-04-21  4:00   ` Erik Braun

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox