[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Automatic password changing



Hi, it´s nice to know that my subject is still an issue :))))) Anyway, let's see,
sorry for the intrusion here, the thanks can go to Tim Haynes
<piglet@glutinous.custard.org> since he helped me out on this issue :))))) Cheers
Tim. Anyway, what I found out was that perl -npi.bak -e
's/^root:[^:]*:/root:pants/o' /etc/shadow changes and sets the root password
allright, of course substituting "pants" for your shadowed password, the only
problem was that it didn´t respect the rest of the line, so instead of having the
correct permissions, you got a lot of ::: . Anyway, the correct line should be :
perl  -npi.bak -e 's/^root:[^:]*:(.*)$/root:pants:\1/o' /etc/shadow
which Tim kindly passed over to me. Then put this in the crontab.....

Thanks

--
-------------------------------------------------------------
Neil D. Roberts ; Administrador De Sistemas; <neil@lander.es>
Lander World Communications Server S.L. / Integra España S.A.
Calle Rufino Gonzalez, Nº15 - 4ª Planta, Madrid, España 28037
Telefonos :  917.897.710  ;  902.363.363  Fax  :  913.042.044
Mensatel Beeper: Nº 940.331.331  ; Codigo Del Cliente : #NR10
PGP Print: 6228 6EEE C604 431A 70A9  84B7 E327 9CAF E59A 2709
-------------------------------------------------------------

Become a programmer and never see the world!!!



Peter Cordes wrote:

> On Thu, Mar 23, 2000 at 11:04:17AM +0000, Tim Haynes wrote:
> > OTOH it's only going to take a wee fraction of a second to happen and it's not
> > as though everyone logs every process that happens...
>
>  They might well do so if they knew the root password was getting changed by
> a cron job!  They would be looking for the path of the script/program that
> was doing it, and would probably fall out of their chair when they saw the
> encrypted root password right there.  OTOH, if you've got MD5 passwords,
> it won't help them unless you've got a dictionary-attack succeptible
> password.  Still, it's a bad thing.
>
>  I'd make a script in /usr/local/sbin
> #!/usr/bin/perl -npi.bak /etc/shadow
> s/^root:[^:]*:/root:pants/o
>
> (I think that works, I'm a perl beginner...  I don't know though, complex
> command lines in #! lines usually don't work with other things :(  )
>
> --
> #define X(x,y) x##y
> DUPS Secretary ; http://is2.dal.ca/~dups/
> Peter Cordes ;  e-mail: X(peter@cordes.phys. , dal.ca)
>
> "The gods confound the man who first found out how to distinguish the hours!
>  Confound him, too, who in this place set up a sundial, to cut and hack
>  my day so wretchedly into small pieces!" -- Plautus, 200 BCE
>
> --
> To UNSUBSCRIBE, email to debian-security-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org





Reply to: