Re: Auto Pass Changing : Subject changes to OOPS :)
On Wed, Mar 22, 2000 at 12:36:59PM +0100, Neil D. Roberts wrote:
> Hi, um, bad news ? Yep, but I was lucky though . . .
>
> Ok, I got the perl -npi.bak -e 's/^root:[^:]*:/root:pants/o' /etc/shadow ,
> pants being my shadowed password. I put this in a file called fixpw.sh,
> chmoded it to 700 and executed it. Then on tty2 I tried to login and it
> didn´t let me, so before I did anything, I did a passwd to my original
> password, and then went to check out the /etc/shadow file, and I´m afraid to
> say, that the root line
> which was originally root:/pants:11012:0:99999:7::: has changed to
> root:/pants11012:::::: I think this is a slight little problem, but I
> took care in "trying" before implementing this. Anyway, now that things
> are almost back to normal in my shadow file, does any new ideas come up
> ?
Hokay. The perl s/// bit doesn't take into account the rest of the line,
oopsie. Try something like
perl -npi.bak -e 's/^root:[^:]*:(.*)$/root:pants:\1/o' /etc/shadow
(the idea being that the \1 refers back to whatever matched the (.*) .)
As someone else has said, btw, would you recognise your own encrypted root
password? (Would whoever mailed me that directly please bounce it to the
*list* as well?!)
~Tim
--
| Geek Code: GCS dpu s-:+ a-- C++++ UBLUAVHSC++++ P+++ L++ E--- W+++(--) N++
| w--- O- M-- V-- PS PGP++ t--- X+(-) b D+ G e++(*) h++(*) r--- y-
| The sun is melting over the hills, | http://piglet.is.dreaming.org/
| All our roads are waiting / To be revealed | piglet@glutinous.custard.org
Reply to: