General discussion
-
CreatorTopic
-
November 10, 2004 at 5:40 am #2276316
forgot linux root password
Lockedby lavi0007 · about 17 years, 6 months ago
i forgot my linux root password….is there any way to recover it…..or i’ll have to re-install the o.s…???
Topic is locked -
CreatorTopic
All Comments
-
AuthorReplies
-
-
November 10, 2004 at 7:08 am #3313366
Reply To: forgot linux root password
by bfilmfan · about 17 years, 6 months ago
In reply to forgot linux root password
You aren’t the only person that has had that pleasure. Lots of help here:
-
November 10, 2004 at 8:33 pm #3312790
Reply To: forgot linux root password
by vdanen · about 17 years, 6 months ago
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. -
November 24, 2004 at 12:29 am #3310961
Reply To: forgot linux root password
by jopoy · about 17 years, 6 months ago
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.
-
November 27, 2004 at 11:34 am #3314895
Reply To: forgot linux root password
by henrymercedes · about 17 years, 6 months ago
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
-
November 29, 2004 at 10:49 pm #3315463
Reply To: forgot linux root password
by mullapudi3 · about 17 years, 5 months ago
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 -
December 2, 2004 at 8:25 am #3314151
Reply To: forgot linux root password
by alokchauhan1 · about 17 years, 5 months ago
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
-
December 3, 2004 at 4:31 pm #3316062
Reply To: forgot linux root password
by ben · about 17 years, 5 months ago
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?
-
January 11, 2005 at 4:24 pm #3346309
Reply To: forgot linux root password
by csturman · about 17 years, 4 months ago
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…..
-
February 21, 2005 at 12:51 pm #3333638
Reply To: forgot linux root password
by jdclyde · about 17 years, 3 months ago
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/shEdit out the encrypted password (don’t touch anything else!) so that the line reads something like
root::0:0:God,Everywhere:/:/bin/shSave the file and shut down. Reboot from the hard drive. Your root password has now been removed, and you can reset it normally.
-
March 17, 2005 at 12:56 am #3352344
Reply To: forgot linux root password
by kannan.santhosh · about 17 years, 2 months ago
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. -
August 19, 2008 at 11:15 pm #2927986
Reply To: forgot linux root password
by susantaroul · about 13 years, 9 months ago
In reply to forgot linux root password
I forgot my linux root password. How to get my passward
-
May 3, 2011 at 7:46 am #2882725
Hope this helps!
by meanoleman · about 11 years ago
In reply to Reply To: forgot linux root password
Lost root passwd
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.
-
-
May 3, 2011 at 7:45 am #2882726
Lost root passwd
by meanoleman · about 11 years ago
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.
-
-
AuthorReplies