![]()
From: Serdar Aydemir (serdar_aydemir@koytur.com)
Date: Thu 01 Apr 2004 - 09:08:06 EST
Slm, Biz zamanlar benimde basima gelmisti. Asagidaki dokuman sayesinde
cozmustum..
Umarim isinize yarar..
Kolay gelsin......
You cannot "recover" the root password, but you can easily set it to
> whatever you want. Here's how:
> 1. Login to the box as a normal user, and run the 'mount' command to
> determine which is your root partition:
> $ mount
> /dev/hdb3 on / type ext3 (rw)
> proc on /proc type proc (rw)
> [...]
> /dev/hdb6 on /usr type ext3 (rw)
> /dev/hdb7 on /var type ext3 (rw)
> So, in this case, /dev/hdb3 is your root parition, and /dev/hdb6 is
your
> /usr partition. Write both of these down.
> 2. Grab a Linux distribution CD that contains a rescue disk. I know that
> Red Hat 7.1 and greater will work, and all the Gentoo Linux versions also.
> I would imagine that Mandrake sports a resue disk as well.
>
> 3. Boot up your system off that CD and select rescue mode. In Gentoo, you
> don't have to select it--a Gentoo installation is a kind of rescue in
> itself.
> 4. Once you are at a prompt, create a mount point for your root
filesystem:
> $ mkdir /sys_root
> 5. Now, mount your root filesystem:
> $ mount -t reiserfs -o rw /dev/ROOT /sys_root
> Where ROOT is the device name that you noted in step 1 (in my example,
> ROOT would be hdb3).
>
> 6. Mount your /usr filesystem:
>
> $ mount -t reiserfs -o rw /dev/USR /sys_root/usr
>
> Where USR is the device name that you noted in step 1 (in my example,
> USR would be hdb6)
>
> 7. Bind /proc to your /sys_root/proc mountpoint:
>
> $ mount -o bind /proc /sys_root/proc
>
> 8. Create a chroot jail:
>
> $ cd /sys_root
> $ chroot /sys_root /bin/bash
>
> 9. Set your root password:
>
> $ passwd
> New UNIX password:
> Retype new UNIX password:
>
> 10. Escape from the jail, unmount your filesystems, and reboot:
>
> $ exit
> $ umount /sys_root/usr
> $ umount /sys_root/usr
> $ umount /sys_root
> $ reboot
>
![]()