PDA

View Full Version : lac pasword root Linux. xin cao thu giup



trunghauhk
14-06-2004, 09:15 AM
Hiện I đang dùng Redhat 9.0, bi lạc mất pass root "hu hu... sắp bị mất trắng rồi" xin được cao thủ chỉ giúp.

tuaninbox
14-06-2004, 03:19 PM
- Bạn vào chế độ linux rescue (boot từ CD).
- Mount /mnt/sysimage.

Từ đây bạn có thể mở file /etc/passwd hay /etc/shadow để chỉnh sửa password. Nếu không thể write được các file này thì bạn hãy chmod nó để có thể write được.

Thân mến.

ndt
14-06-2004, 04:19 PM
Theo cách của tuaninbox cũng được hoặc có thể thử :


Help! I forgot my root password. How do I log in now?

You can log in using single-user mode and create a new root password.

To enter single-user mode, reboot your computer. If you use the default boot loader, GRUB, you can enter single user mode by performing the following:


At the boot loader menu, type [e] to enter into editing mode.

You will be presented with a boot entry listing. Look for the line that looks similar to the following:

kernel /vmlinuz-2.4.18-0.4 ro root=/dev/hda2


Press the arrow key until this line is highlighted and press [e].

Press the Spacebar once to add a blank space, then add the word single to tell GRUB to boot into single-user Linux mode. Press [Enter] to make the editing change take effect.

You will be brought back to the edit mode screen. From here, press [b] and GRUB will boot single-user Linux mode. After it finishes loading, you will be presented with a shell prompt similar to the following:

sh-2.05#


You can now change the root password by typing

bash# passwd root


You will be asked to re-type the password for verification. Once you are finished, the password will be changed. You can then reboot by typing reboot at the prompt; then you can log in to root as you normally would

Và rất nhiều thứ bạn có thể tìm ở Red Hat Linux 9: Red Hat Linux Getting Started Guide trong đĩa docs kèm theo với bộ RH9