On Sat, 2003-04-05 at 15:25, Michael Adams wrote:
> On Sat, 05 Apr 2003 06:38, James Sparenberg wrote:
> > On Sat, 2003-04-05 at 02:27, Molotov wrote:
> > > Hello
> > >
> > >
> > > Well, I need some advice for a classic problem... I am now unable to get
> > > access to one of my computers, as I forgot my password (root account).
> > > I still have a basic user password, but - no luck - it has expired.
> > >
> > > In fact, I am trapped out of my box ;-)
> >
> > Ok,  Been there done this... fixed it.
> >
> > 1.  boot from the rescue disk (disk 1 on your distro) chose f1 at the
> > prompt
> > 2.  at the new prompt type rescue (as the instructions will tell you.)
> > 3.  When the new window comes up (btw it will look like it's going to
> > start an install don't worry it won't)  select with the arrow keys mount
> > installed system.
> > 4.  After it mounts chose go to prompt.
> 
> 5. # chroot /mnt (may need to /mnt/usr/sbin/chroot)
> 6 # passwd
> Enter in root's new password when prompted.

This may work in many caseses... HOWEVER I've had it happen a couple of
times that the file passwd was corrupted or otherwise compromised.   (I
found one box that was root kitted .... if you changed the root password
it would send it off to the owner of the kit... ugh.)    I prefer to
take it off line.  make it a no passwd root and find out if my box is
clean.  Paranoid yes... but.. I'm that way *grin*.  

James

> 
> > 5   cd /mnt/etc this is your hdd.
> > 6.  use the command vipw (stands for vipw) in this manor.
> >
> > $ chroot /mnt vipw
> >
> > the above will chroot jail you to your hdd and edit the real password
> > file.
> >
> > 7.  Find the line (should be the first one) That looks like
> >
> > root:x:0:0:root:/root:/bin/bash
> >
> > Change it to look like
> >
> > root::0:0:root:/root:/bin/bash    #Notice I just removed the x.
> >
> > Then wq this file so it's saved.  Immediately a prompt asking if you
> > want to edit shadow password will come up, say yes.  The line for root
> > will look something like this.
> >
> > root:$1$NpWEeIT/$bcb/UR/rGIlDcFdn7C.7b.:12140:0:99999:7:::
> >
> > change it to look like this.
> >
> > root::12140:0:99999:7:::
> >
> > wq to write and save this file.  then exit from the rescue disk...
> > reboot and you will now have a root user with a blank password.
> > WARNING.  Give root a password immediately *grin* upon logging in.
> >
> > How did I learn this... Trial and error and a firewall I hadn't logged
> > into in 14 months.  "oops"
> >
> > James
> >
> > > I have some data I need to get back, and I must find a way.
> > > Of course, I have physical access.
> > > Getting the hard disk to another machine in order to recover data before
> > > a reinstallation is an option, but for different reasons I prefer to
> > > avoid it (SCSI disk on the locked box, no SCSI support in the one I use
> > > now, which is quite full in terms of alim usage).
> > >
> > > Is there a way to get back my password ? I mean, maybe some brute force
> > > utility ? I think I can get the password file with a floppy (after
> > > booting on CD).
> > >
> > > The locked box is Mdk 9, with I think the most paranoid security level.
> > >
> > > Any advice for the stupidest man on Earth ?
> > >
> > > TIA and regards,
> > >
> > > FT


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to