General discussion

  • Creator
    Topic
  • #2276316

    forgot linux root password

    Locked

    by lavi0007 ·

    i forgot my linux root password….is there any way to recover it…..or i’ll have to re-install the o.s…???

All Comments

  • Author
    Replies
    • #3313366

      Reply To: forgot linux root password

      by bfilmfan ·

      In reply to forgot linux root password

      You aren’t the only person that has had that pleasure. Lots of help here:

      http://cities.lk.net/lost_password.htm

    • #3312790

      Reply To: forgot linux root password

      by vdanen ·

      In reply to forgot linux root password

      This is very easy to do. Reboot or start your computer with the
      install CD or a downloadable Live CD. If the CD has it, boot into
      rescue mode (ie. Mandrakelinux CDs let you boot into rescue
      mode). You should then be able to mount your partitions,
      although you really only need to mount your / partition. For
      instance, if /dev/hda2 was your / partition, you might mount it
      as /tmp/cdrom or /mnt/cdrom or something by doing “mount /
      dev/hda2 /tmp/cdrom”; depending on the distro you may need
      to pass the fs type to mount (ie. “mount -t reiserfs /dev/hda2 /
      tmp/cdrom”). Anyways, once this is done type “chroot /tmp/
      cdrom” and then you’ll be chrooted (or jailed, locked into) your /
      filesystem. Make sure you’re doing this as the root user! Once
      you’ve done that, you can just type “passwd [user]” or “passwd”
      (to change root’s pw) and reset your password.

    • #3310961

      Reply To: forgot linux root password

      by jopoy ·

      In reply to forgot linux root password

      What boot loader are you using?

      If you are using LILO:
      At the boot loader options type “linux single”

      If you are using GRUB:
      observe the kernel parameters, just change the init option at the end of the boot options/parameters to 1. (It’s been a long time since I rebooted so please bear with me)

      This will boot you to single user mode. You will then be able to user “passwd” to change your password. If all else fails, try searching google with the string “how to boot linux in single user mode”

      hth.

    • #3314895

      Reply To: forgot linux root password

      by henrymercedes ·

      In reply to forgot linux root password

      you have to reboot your pc with lilo and after that type linux single, to enter in single user mode the in the prompt type use passwd to change the password and then reboot

    • #3315463

      Reply To: forgot linux root password

      by mullapudi3 ·

      In reply to forgot linux root password

      1)While booting at botrecord press e to edit
      2)u can see the kernel-hd0
      by moving the arrows highlight that and then press enter
      3)now press space bar once at type single then press enter
      4)press b to boot
      5)you will get sh#
      6)type passwd root
      type new password
      retype password
      7)type reboot to boot again

    • #3314151

      Reply To: forgot linux root password

      by alokchauhan1 ·

      In reply to forgot linux root password

      yes u can break it if it is grub loader then on boot option screen press ” e ” key of keybord to edit the boot loader setting n go to the second line of boot loader then again press ” e ” key n give a gap after all words and type ” 1 ” for single and press Enter key then press ” b ” key to boot into modified loader. now it will boot the system in single user mode or root without prompting any user or password then u can changer the password by ” passwd ” command for root. same procedure u can follow for LILO boot loader but to edit u have to press Ctrl+C first and then u can edit it by the same procedure. i hope this will work for u. best of luck

    • #3316062

      Reply To: forgot linux root password

      by ben ·

      In reply to forgot linux root password

      I had a similar experince and the posts on this page were helpful in resolving my problem. So thanks to all those that posted. I’m using Mandrake 10.1, and noticed that while changing my password allows me to logon as root while using specific configuration tools, when I try to anything as root (SUDO) via CLI I’m told that my password is invalid. Did I miss something?

    • #3346309

      Reply To: forgot linux root password

      by csturman ·

      In reply to forgot linux root password

      Not to be a pain but this question gets asked in the forums of JustLinux.Com a lot by wannabe hackers…..

    • #3333638

      Reply To: forgot linux root password

      by jdclyde ·

      In reply to forgot linux root password

      I will assume you have physical access, as this can’t be done remotely and if you don’t have access you have no business getting on.

      http://aplawrence.com/SCOFAQ/FAQ_scotec1root_1.html

      How do I reset the root password if I forget it? (part 1)

      This procedure will work for Xenix, and for Unix as well if you are using a very relaxed security level (one which stores encrypted passwords directly in /etc/passwd). If you’re using a higher security level on Unix, look for part 2 below.

      For Linux, see http://www.aplawrence.com/Linux/lostlinuxpassword.html

      For Unixware 2.12, http://aplawrence.com/Bofcusm/2438.html adds some useful info.

      Boot the system from your emergency boot diskettes (if you didn’t make these and keep them up to date, shame on you, but you should be able to use N1/N2 instead, and see the entry on crashing out of these diskettes below). Next,

      mount /dev/hd0root /mnt

      ; this will mount your hard drive’s root filesystem on /mnt.

      On some v5.0.x systems, /dev/hd0root won’t exist. Create it with

      mknod /dev/hd0root b 1 42

      See also http://aplawrence.com/cgi-bin/ta.pl?105094

      Edit /mnt/etc/passwd. The first line will be your root line, such as
      root:encryptedpasswordgoeshere:0:0:God,Everywhere:/:/bin/sh

      Edit out the encrypted password (don’t touch anything else!) so that the line reads something like
      root::0:0:God,Everywhere:/:/bin/sh

      Save the file and shut down. Reboot from the hard drive. Your root password has now been removed, and you can reset it normally.

    • #3352344

      Reply To: forgot linux root password

      by kannan.santhosh ·

      In reply to forgot linux root password

      First login to single mode user to do that:
      press e for edit .
      then type sigle at end of the line and press b to boot.
      After that it will boot in single mode type passwd.It will ask for a new root passwrd .Then type init6 to restart.

    • #2927986

      Reply To: forgot linux root password

      by susantaroul ·

      In reply to forgot linux root password

      I forgot my linux root password. How to get my passward

    • #2882726

      Lost root passwd

      by meanoleman ·

      In reply to forgot linux root password

      I’ll take the privilige provided by the author of this great howto and share it.
      I can verify it works on my CentOS-5 and every Fedora I’ve tried it on.

      http://linuxgazette.tuwien.ac.at/107/tomar.html

Viewing 11 reply threads