LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2009, 07:23 AM   #1
shadow_rana
LQ Newbie
 
Registered: Jun 2009
Posts: 3

Rep: Reputation: 0
how to recover rootpassword in open suse 11.1


hello every body,

good evening. I am new to linux world. i am now facing a problem which is as follows.

I installed open suse 11.1 and doing my work. and unfortunately i forgot my root password. i am unable to boot into thhe system.I have tried following things but i couldnt recover my password

1)i tried by typing init="/bin/bash" and then mounted my root(/) partition and thhen later whhen i tried to change password with passwd command it is showing error as follows.

"/usr/share/cracklib/pw_dict-pwd.gz:no such file or directory
PWopen:No suchh file or directory"

2)also i have tried to work in resque mode but there i cannot unable to type any thhing


please help me
waiting for ur help


regards
sivakiran
 
Old 06-19-2009, 07:33 AM   #2
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,275

Rep: Reputation: 148Reputation: 148
In single usermode you can edit /etc/shadow file, check the root line there are some encrypted things,
Quote:
root:$1$HgMt5gHP$qoREbmB5OTurLBEesdmCw/:14372:0:99999:7:::
remove that highlighted things from your shadow file and reboot

Last edited by kirukan; 06-19-2009 at 07:35 AM.
 
Old 06-19-2009, 07:38 AM   #3
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295Reputation: 1295
Hello,

Below two different ways. This one is for Debian but should work on your distro also.

“I forgot the root password!” (1)

It is possible to boot a system and log on to the root account without knowing the root password as long as one has access to the console keyboard. (This assumes there are no password requests from the BIOS or from a boot loader such as lilo that would prevent one from booting the system.)

This is a procedure which requires no external boot disks and no change in BIOS boot settings. Here, “Linux” is the label for booting the Linux kernel in the default Debian install. At the lilo boot screen, as soon as boot: appears (you must press a shift key at this point on some systems to prevent automatic booting and when lilo uses the framebuffer you have to press TAB to see the options you type), enter:

boot: Linux init=/bin/sh

This causes the system to boot the kernel and run /bin/sh instead of its standard init. Now you have gained root privileges and a root shell. Since / is currently mounted read-only and many disk partitions have not been mounted yet, you must do the following to have a reasonably functioning system.

# mount -n -o remount,rw /
# mount -avt nonfs,noproc,nosmbfs
# cd /etc
# vi passwd
# vi shadow

(If the second data field in /etc/passwd is “x” for every username, your system uses shadow passwords, and you must edit /etc/shadow.) To disable the root password, edit the second data field in the password file so that it is empty. Now the system can be rebooted and you can log on as root without a password. When booting into runlevel 1, Debian (at least after Potato) requires a password, which some older distributions did not.

“I forgot the root password!” (2)

Boot from any emergency boot/root disk set. If /dev/hda3 is the original root partition, the following will let one edit the password file just as easily as the above.

# mkdir fixit
# mount /dev/hda3 fixit
# cd fixit/etc
# vi shadow
# vi passwd

The advantage of this approach over the previous method is one does not need to know the lilo password (if any). But to use it one must be able to access the BIOS setup to allow the system to boot from floppy disk or CD, if that is not already set.

Restore deleted critical files such as /etc/passwd

Debian stores backups of critical files such as passwd, shadow, aptitude config files, … on a regular basis in /var/backups. If you accidentally delete one of these files you can copy them back to the original location. After doing so you might need to reset the permissions on the files to 644.

Kind regards,

Eric

Last edited by EricTRA; 06-19-2009 at 07:40 AM.
 
Old 06-19-2009, 08:00 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Do NOT change the shadow file even with sudo. I have question for you. Why are you unable to boot into system? You have just lost root password. You do not need it for you can do your admin work with sudo.

To rescue the password you need to edit the kernel parameters from the Grub and enter single user mode where you can change the password.

While you are at grub screen press "e". Look for line with kernel parameters and then edit the line and at the end of it put 1 (one numeric).
And then at this line press "B" to boot into single user mode. This is like safe mode where you directly enter as root without user name and password. Now change the password with passwd command.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How Do I recover a user's password in SUSE 10.0 gamesfan9000 SUSE / openSUSE 26 01-28-2010 08:53 AM
how to recover Suse 11.0 /boot files if Ubuntu's grub lost them & can't boot to suse streams &dragonflies SUSE / openSUSE 6 10-18-2008 09:17 PM
Help! - I can't remember my rootpassword in SuSe 9.1 larsemu SUSE / openSUSE 4 06-13-2007 03:39 PM
How to recover the root password in suse 10.1 suse91pro Linux - Security 2 10-24-2006 08:36 AM
can I recover from disk full - without reboot ? can't open display dtimms Linux - Software 3 09-19-2004 01:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration