[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Looking for a perl script for linux
You can use expect shell
set password [lindex $argv 1]
spawn passwd [lindex $argv 0]
expect "password:"
sleep .01
send "$password\r"
expect "password:"
sleep .01
send "$password\r"
expect eof
Mike
Oded Arbel wrote:
> On 10 May 1999, Oleg Goldshmidt wrote:
>
> > Elchanan Sharon <elchanan@smlink.com> writes:
> >
> > > I am looking for a perl script that adds user
> > > to linux OS.
> > > You can point me to RTFM pointer
> > > if the answer is too obvious.
> >
> > Will a bash script do? Look for adduser. It's probably
> > /usr/sbin/adduser, but your mileage may vary.
> I'm looking into it myself, and one thing I've found out already, assuming
> that you want to do it for the same reason as I - for a web interface,
> that using bash scripts (or perl for that matter - not that you can) is a
> very bad idea....
>
> you need to write a c program to do this, otherwise it's as secure as
> posting your passwords on a bill board (not that the whole practice is
> very secure, but it's better then letting your non-techs hang around in
> the system with root premissions).
>
> Oded
> --
> -------------------------------------
> Indifference will certainly be the downfall of mankind, but who cares?
--
Mike Almogy
Mofet System Administrator.
Pho :972-03-6901417
Cel :972-052-562237
Fax :972-03-6901414