LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-12-2003, 02:12 PM   #1
sdsouza
LQ Newbie
 
Registered: Nov 2003
Posts: 11

Rep: Reputation: 0
Reset Root password


Hi,

I was trying to login to my system runing linux 7.3 and i feel that the root password has been changed or something .. it is not taking it ..

I can login as another user ..

is there any way i can reset the root password without knowing the root password ..

I don't wanna lose al the data on the server... so don't wanna reinstall everything ..

can someone help me with this .

thanks,
sdsouza
 
Old 11-12-2003, 02:32 PM   #2
Jinkzer
LQ Newbie
 
Registered: Jun 2003
Location: Stockholm Sweden
Distribution: Gentoo, Slackaware, Flux, KDE
Posts: 20

Rep: Reputation: 0
On the boot: prompt, type in "linux single" + Enter, at # after a while write passwd root and write your new password 2 times.

Good luck!
 
Old 11-12-2003, 02:35 PM   #3
Thymox
Senior Member
 
Registered: Apr 2001
Location: Plymouth, England.
Distribution: Mostly Debian based systems
Posts: 4,368

Rep: Reputation: 64
Welcome to LQ, sdsouza.

Unfortunately asking how to change to root password of a system without logging in as root (ie not doing it the normal way) can sound like a bit of a dodgy thing to ask. With this in mind, please be aware that you may get a few uncalled-for replies. However, there are ways of doing so, and they have been covered before on these forums. I'll give you a hint as to what to do: it has something to do with booting to the appropriate run-level, but nothing to do with editing your /etc/inittab file to set the default runlevel.

Happy searching

Or, just take the answer from the above reply that was posted whilst I was writing this reply... D'oh!

Last edited by Thymox; 11-12-2003 at 02:36 PM.
 
Old 11-12-2003, 03:03 PM   #4
sdsouza
LQ Newbie
 
Registered: Nov 2003
Posts: 11

Original Poster
Rep: Reputation: 0
Reset the root password

Hi,

Can u tell me in a little more detail .. becasue I don't know how to get to the boot prompt..

thanks,
sdsouza
 
Old 11-12-2003, 03:54 PM   #5
Jinkzer
LQ Newbie
 
Registered: Jun 2003
Location: Stockholm Sweden
Distribution: Gentoo, Slackaware, Flux, KDE
Posts: 20

Rep: Reputation: 0
Ok, try this.

This is pretty advanced so take it very easy. If you do it wrong it could ruin your system and that is not my fault (I tried it on my system just to make sure). Be careful, m'kay?

If you have the installation media on CD, boot of that. (RH CD1)
when you see the boot: (where you usually press ENTER to install), type "linux rescue" + ENTER
Let the installation program start, use language "English" + [OK], set your Keyboard type + [OK]. You will get a question about the installation wanting to find your RH installation, agree to that.
After a couple of seconds you get a success-message and you can press [OK] to return to shell.
type
vi /mnt/sysimage/etc/shadow

if this file is empty (was not found) try

vi /mnt/sysimage/etc/passwd

You should get a file with all your users in it. Find your root user (usually on the top).
it looks like:
root:!"951""!"%"%#(/%#:11111:0:11111:4::::
or something similar.
use your arrow-keys to get to the first character after root: (in the example above, the "!".
press the "x" on your keyboard. This will remove one character every press. Remove everything to the next : so the line looks like
root::11111:0:11111:4:::::
save the file with the following key sequence
[ESC] : wq!
in the shell-prompt, type "exit" and the system will reboot.

Remove the CDROM and boot your system up.
at the loginprompt type root + ENTER.
Your're in!
Change root-password with the command
passwd root
and don't dare to forget it again

Last edited by Jinkzer; 11-12-2003 at 03:59 PM.
 
Old 11-12-2003, 04:50 PM   #6
sdsouza
LQ Newbie
 
Registered: Nov 2003
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a Million.. It worked..

sdsouza
 
  


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
Reset Root password hbenway AIX 9 08-19-2008 04:13 PM
reset root password kapslock Debian 14 07-27-2006 07:08 AM
How to reset forgotten root password comprookie2000 Linux - Newbie 4 10-28-2004 12:33 PM
Preventing root password reset J.W. Linux - Security 2 04-07-2004 03:04 AM
how do i stop root password reset? robhargreaves Linux - Security 3 01-31-2004 09:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:49 AM.

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
Open Source Consulting | Domain Registration