Welcome, Guest. Please login or register.

Author Topic: Linux root password mystery  (Read 2696 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show all replies
    • http://www.iki.fi/sintonen/
Re: Linux root password mystery
« on: December 12, 2008, 07:28:46 AM »
@orb85750

Basically you boot in single user, edit /etc/shadow file and remove the password for the root user, save changes, reboot. You typically do not need any boot CDs for this.

One neat trick is:
Add "init=/bin/sh" to linux kernel boot command.

Then in shell:
Code: [Select]

mount -o remount,rw /
passwd
(enter the new password when prompted)
mount -o remount,ro /
sync

And then reset the system.

Different linux versions might have other easier means to do it, though. You could also ask google, which gives you detailed instructions for Redhat such as:
http://www.go2linux.org/fedora-centos-root-password-recovery
http://kbase.redhat.com/faq/docs/DOC-1193