Don't abuse this and only use it on your own systems!
When using the ultimate rescue tools we sometimes need to perform commands on the system we are rescuing.
Our liveCD will access the rescue system but you cannot run native commands on the computer you are rescuing - not out of the box.
So from our rescue system I fire up SystemrescueCD and mount the system I try to rescue - let us say it is a Mageia computer:
Code: Select all
mkdir /mnt/mageia
and then
Code: Select all
mount /dev/sda1 /mnt/mageia
I found that my Mageia partition was on /dev/sda1 with
Code: Select all
fdisk -l
You will get an even better overview if you use:
Code: Select all
fsarchiver probe simple
That is it; you can now do a CD to /mnt/mageia and browse the content of your Mageia system. But you will notice that the Mageia local commands do not work.
So I have this need to change the lost password on Mageia because I cannot log into it anymore
to achieve this I need to change root or chroot:
Code: Select all
chroot /mnt/mageia /bin/bash
This switches you to the root system of Mageia and runs the Bash shell as root.
(You need to be root for this but you always are with SystemrescueCD so that is no problem)
Now you can try urpmi etc and it will work (sort of) but I want to change my password....
so I simply do a
Code: Select all
passwd viking
..and get nicely prompted for a new password to enter -twice.
So far so good and then .. an error message.
Code: Select all
passwd: Authentication token manipulation error
There seem to be some built in security mechanisms so I will have to drop the changing part and simply delete the password I have forgotten then:
Code: Select all
passwd -d viking
again confirm etc and...success
...
Time to clean up then
CTRL+D to jump out of the chroot environment and then a CD to ~/ before:
Code: Select all
umount /mnt/mageia
...
I rebooted and logged right in without a password.
..And set a new password that I remember in the Mandriva Control Center.
Our rescue system works!
The challenge I had to face here was that Mageia did not accept the password change - on the fly. Mageia does accept the deletion of a password though so that you can set a new one from within Mageia.
Other distros will let you change the password on the fly.
Other tools in the Viking toolbox like Rescatux will simply fail when trying to change the password with a "something went wrong" message - so Mageia is stubborn.
But in the end it could not resist the feroucious berserk attack
Other distros like Debian do behave better.
I can chroot into it and update with apt-get and change the password on the fly - no problem. If you simply want to change your password; Rescatux will probably be easier to use and it works just fine (with all except Mageia Fedora and Centos).