Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* passwd redirection
@ 1994-07-13 18:45 Bob Nance
  1994-07-15 15:10 ` Roberto Dorich
  1994-07-16 18:18 ` Gary Newman
  0 siblings, 2 replies; 4+ messages in thread
From: Bob Nance @ 1994-07-13 18:45 UTC (permalink / raw)


Hi all!

	I have a need to run the passwd application and have it
take input from stdin. This is how I'd like to do it...

	% passwd < secure_password_change_file

where the file contains:

	oldpassword
	newpassword
	newpassword

Unfortunately, it appears that passwd does not read from stdin, so
this does not work. Does anyone have any ideas on a way to do this?

-- 
+---------------------------------------------------------+
| Bob Nance                           nance@niehs.nih.gov |
| Senior Network Engineer                 N4WWN / General |                 
| ISN                                 (919) 361-9422 x238 |
| The National Institute of Environmental Health Sciences |
+---------------------------------------------------------+


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

* Re: passwd redirection
  1994-07-13 18:45 passwd redirection Bob Nance
@ 1994-07-15 15:10 ` Roberto Dorich
  1994-07-17 12:23   ` A. Andrew Brennan
  1994-07-16 18:18 ` Gary Newman
  1 sibling, 1 reply; 4+ messages in thread
From: Roberto Dorich @ 1994-07-15 15:10 UTC (permalink / raw)


>>>>> "Bob" == Bob Nance <nance@niehs.nih.gov> writes:

Bob> Hi all!  I have a need to run the passwd application and have it
Bob> take input from stdin. This is how I'd like to do it...

Bob> 	% passwd < secure_password_change_file

Bob> where the file contains:

Bob> 	oldpassword newpassword newpassword

This is not very secure...  We only want to do it to reset passwords,
so only root will be able to do it (without entering an old password).

Bob> Unfortunately, it appears that passwd does not read from stdin,
Bob> so this does not work. Does anyone have any ideas on a way to do
Bob> this?

We are planning to use the expect program down here (expect-5.8 compiles
just fine under osf).  I also made a C program to do the same thing by
actually rewriting the password files this worked fine with a dummy
passwd file, but I am not sure if the putpwent(3) functions take care
of all the ins and outs of passwd.  Doesn't osf use dbm files for this?

Rob
--

Roberto Dorich	     	  o       SKI		rdorich@emerald.tufts.edu
Electrical Engineering   /=     EXTREME	 	rdorich@athena.mit.edu
Tufts University        __/__,           uucp:	roberto@kastle.ext.tufts.edu 
----------------------------------------------------------------------------


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

* Re: passwd redirection
  1994-07-13 18:45 passwd redirection Bob Nance
  1994-07-15 15:10 ` Roberto Dorich
@ 1994-07-16 18:18 ` Gary Newman
  1 sibling, 0 replies; 4+ messages in thread
From: Gary Newman @ 1994-07-16 18:18 UTC (permalink / raw)


Bob Nance (nance@niehs.nih.gov) wrote:
: 	I have a need to run the passwd application and have it
: take input from stdin. This is how I'd like to do it...
: [snip]
: Unfortunately, it appears that passwd does not read from stdin, so
: this does not work. Does anyone have any ideas on a way to do this?

A while ago I read the source code and found that passwd reads from
/dev/tty which is the controlling tty of the current process, rather
than stdin.

In order to do what you want, I ran the change script with "at" which
is started by the init process and thus has no controlling tty.  It
then defaults to read stdin.  This was all done on a Sun with SUNOS4.X
so I don't know how similar the source code to passwd is in OSF/1.
-- 
Gary Newman                             gnewman@xmx.com
XMX Corp.                               voice: (617) 275-9694
One Oak Park                            Fax:   (617) 271-9164
Bedford, MA 01730


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

* Re: passwd redirection
  1994-07-15 15:10 ` Roberto Dorich
@ 1994-07-17 12:23   ` A. Andrew Brennan
  0 siblings, 0 replies; 4+ messages in thread
From: A. Andrew Brennan @ 1994-07-17 12:23 UTC (permalink / raw)


In <RDORICH.94Jul15111033@Emerald.tufts.edu> rdorich@Emerald.tufts.edu writes:
> >>>>> "Bob" == Bob Nance <nance@niehs.nih.gov> writes:
> 
> This is not very secure...  We only want to do it to reset passwords,
> so only root will be able to do it (without entering an old password).
> 
> Bob> Unfortunately, it appears that passwd does not read from stdin,
> Bob> so this does not work. Does anyone have any ideas on a way to do
> Bob> this?
> 
   We were interested in the same thing (and have expect on our system, in
   fact) but realized that the database on our OSF/1 box didn't actually 
   require that anyone login directly to use it.  Instead, we cheated by 
   blocking all of the passwds and creating a heap of .rhosts ...

   Someone tell me that OSF/1 doesn't have a hole in the rlogin routines -
   I've recently seen stuff about an HP (AIX?) hole to this effect.

   andrew.  (brennan@hal.hahnemann.edu)


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

end of thread, other threads:[~1994-07-17 12:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1994-07-13 18:45 passwd redirection Bob Nance
1994-07-15 15:10 ` Roberto Dorich
1994-07-17 12:23   ` A. Andrew Brennan
1994-07-16 18:18 ` Gary Newman

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