Path: gmdzi!unido!mcsun!uunet!know!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!
dsinc!bagate!sjuphil!brunette
From: brune...@sjuphil.uucp (Glenn M. Brunette)
Newsgroups: comp.unix.questions,comp.unix.admin
Subject: Changing Passwords From A Batch File
Message-ID: <1990Nov12.035942.14096@sjuphil.uucp>
Date: 12 Nov 90 03:59:42 GMT
Organization: Saint Joseph's University
Lines: 33
Posted: Mon Nov 12 04:59:42 1990




I was wondering if it is possible to change a users password by redirecting 
input from a data file.  At our installation, there are about 40 temporary
accounts that need to exist, but because of problems that we have been having
with them, we would like to set up a cron that would change the password 
as needed.  The cron part is easy, but getting the passwd program to 
recognise the input redirection is what is giving us the program. Does anyone
have any ideas?

Ideally we would want something like this:

   #changepw "oldpasswd" "newpasswd"

that would go through all of the desired accounts and change the passwords
to those directed.

BTW, we are running SunOS 4.1 on a Sun SparcServer 4/490.  


Thanks in advance,

   Glenn


-- 
******************************************************************************* 
 Glenn Brunette,  Academic Computing Consultant              sssss
                                                           ss      jjjjjjj
 Addresses:  brunette%sjuphil.sju....@bagate.bell-atl.com   sss      j
             brune...@sjuphil.UUCP                           ss     j  u    u
             brunette%sjuphil....@sh.cs.net             sssss      j  u    u

Path: gmdzi!unido!mcsun!sunic!uupsi!rpi!zaphod.mps.ohio-state.edu!samsung!
cs.utexas.edu!execu!sequoia!rpp386!jfh
From: j...@rpp386.cactus.org (John F. Haugh II)
Newsgroups: comp.unix.questions,comp.unix.admin
Subject: Re: Changing Passwords From A Batch File
Message-ID: <18730@rpp386.cactus.org>
Date: 14 Nov 90 05:15:13 GMT
References: <1990Nov12.035942.14096@sjuphil.uucp>
Reply-To: j...@rpp386.cactus.org (John F. Haugh II)
Organization: Lone Star Cafe and BBS Service
Lines: 16
Posted: Wed Nov 14 06:15:13 1990
X-Clever-Slogan: Recycle or Die.

In article <1990Nov12.035942.14...@sjuphil.uucp> brune...@sjuphil.uucp 
(Glenn M. Brunette) writes:
>Ideally we would want something like this:
>
>   #changepw "oldpasswd" "newpasswd"
>
>that would go through all of the desired accounts and change the passwords
>to those directed.

Ideally you would want to read the user name, old password and
new password from a data file.  The reason is that ps would
be able to see the passwords as they were changed.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: j...@rpp386.cactus.org
"SCCS, the source motel!  Programs check in and never check out!"
		-- Ken Thompson

Path: gmdzi!unido!mcsun!sunic!uupsi!rpi!zaphod.mps.ohio-state.edu!wuarchive!
cs.utexas.edu!chinacat!sequoia!rpp386!jfh
From: j...@rpp386.cactus.org (John F. Haugh II)
Newsgroups: comp.unix.questions,comp.unix.admin
Subject: Re: Changing Passwords From A Batch File
Message-ID: <18731@rpp386.cactus.org>
Date: 14 Nov 90 08:09:43 GMT
References: <1990Nov12.035942.14096@sjuphil.uucp> <18730@rpp386.cactus.org>
Reply-To: j...@rpp386.cactus.org (John F. Haugh II)
Organization: Lone Star Cafe and BBS Service
Lines: 20
Posted: Wed Nov 14 09:09:43 1990
X-Clever-Slogan: Recycle or Die.

In article <18...@rpp386.cactus.org> j...@rpp386.cactus.org 
(John F. Haugh II) writes:
>Ideally you would want to read the user name, old password and
>new password from a data file.  The reason is that ps would
>be able to see the passwords as they were changed.

I've written a utility which does exactly what I described above.
It does not work with SunOS (because of passwd.adjunct), but does
work with V7-format /etc/passwd, and SVR3.2 or SVR4-format
/etc/shadow files.  You pick which one you want at compile time,
and it gives that variety to you.  The code figures out the
difference between SVR3.2 and SVR4 /etc/shadow files (sort of,
it may have problems I don't know about just yet ...)

Depending on how many requests I get I'll either mail individual
copies or post the code to alt.sources.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: j...@rpp386.cactus.org
"SCCS, the source motel!  Programs check in and never check out!"
		-- Ken Thompson

Path: gmdzi!unido!mcsun!sunic!hagbard!eru!bloom-beacon!mintaka!think.com!
zaphod.mps.ohio-state.edu!wuarchive!cs.utexas.edu!execu!sequoia!rpp386!jfh
From: j...@rpp386.cactus.org (John F. Haugh II)
Newsgroups: comp.unix.questions,comp.unix.admin,alt.security
Subject: Re: Changing Passwords From A Batch File
Message-ID: <18741@rpp386.cactus.org>
Date: 17 Nov 90 04:58:33 GMT
References: <18731@rpp386.cactus.org>
Reply-To: j...@rpp386.cactus.org (John F. Haugh II)
Followup-To: comp.unix.admin,comp.unix.questions
Organization: Lone Star Cafe and BBS Service
Lines: 10
Posted: Sat Nov 17 05:58:33 1990
X-Clever-Slogan: Recycle or Die.

In article <18...@rpp386.cactus.org> j...@rpp386.cactus.org 
(John F. Haugh II) writes:
>Depending on how many requests I get I'll either mail individual
>copies or post the code to alt.sources.

Well, I got a number of requests, so I just posted it to alt.sources.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: j...@rpp386.cactus.org
"SCCS, the source motel!  Programs check in and never check out!"
		-- Ken Thompson