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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
09-15-2009, 01:00 AM
|
#1
|
|
LQ Newbie
Registered: Sep 2009
Location: bangalore,india
Distribution: RHEL5
Posts: 11
Rep:
|
i forgot my root password
i am using rhel5.1 ,x86.............
pls teach me how to reset my password...........?

i tried
ssh-3.1# passwd
command in init level 1.....but it is not working

|
|
|
|
09-15-2009, 01:06 AM
|
#2
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
Recovering root password should not be too difficult.
At grub prompt press "e" to edit the options and at the end of kernel line add 1 and press enter.
Highlighting this edited line, press "b" to boot with new parameters.
You will be put on a shell with root privileges.
Use passwd root to change the root password.
|
|
|
|
09-15-2009, 01:06 AM
|
#3
|
|
Member
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367
Rep:
|
boot your machine in single user mode.. in /etc/passwd file against your root entry you may find an an x..delete that x and reboot again.. i think that helps.try it at your own risk(also dont try it on machine that you are not supposed to do).
|
|
|
|
09-15-2009, 01:10 AM
|
#4
|
|
Senior Member
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137
Rep: 
|
Quote:
Originally Posted by spdthespeed
i am using rhel5.1 ,x86.............
pls teach me how to reset my password...........?

i tried
ssh-3.1# passwd
command in init level 1.....but it is not working

|
did you actually boot to runlevel 1?? if not, this is what you need to do.
whilst booting, at the grub window, press the e key. select the image you would like to boot then press the e key again. move the cursor to the end of the line, append a space then the number 1.
then press b.
this will boot to single mode. then run the passwd command.
this normally always works.
the fact that you reach this stage
and you say it doesnt work seems a bit odd as it looks like you are actually the root user at this point. any errors to report?
|
|
|
|
09-15-2009, 01:12 AM
|
#5
|
|
Member
Registered: Jul 2006
Location: Romania
Distribution: Fedora 12
Posts: 160
Rep:
|
There is another way...
Start a livecd linux... open /etc/shadow from livecd system, copy the encrypted password from root(or the whole line), and pasted in /etc/shadow from your rhe system...
I think it will work.
Take an livecd that tell's you the root password, or change it with passwd, and then do the copy...
good luck
|
|
|
|
09-15-2009, 01:15 AM
|
#6
|
|
Member
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367
Rep:
|
Quote:
Originally Posted by strycnine
There is another way...
Start a livecd linux... open /etc/shadow from livecd system, copy the encrypted password from root(or the whole line), and pasted in /etc/shadow from your rhe system...
I think it will work.
Take an livecd that tell's you the root password, or change it with passwd, and then do the copy...
good luck
|
i didnt get you.. can you explain it??
|
|
|
|
09-15-2009, 01:24 AM
|
#7
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
He means to copy the known password directly. Some live cds will ask you to provide password for logging in.
This passowrd will be stored in the passwd and shadow files on the cd.
He wants entry from the known file to be copied to other.
But changing the password from rescue mode is easier.
|
|
|
|
09-15-2009, 01:27 AM
|
#8
|
|
Member
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367
Rep:
|
then two users having same password should have same entry in the shadow file.. am i getting it right.. can that happen?i dont think so..
|
|
|
|
09-15-2009, 01:37 AM
|
#9
|
|
Member
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368
Rep:
|
Quote:
|
i didnt get you.. can you explain it??
|
I have not tried the above, but I have done similar to it. Boot from a Live CD. Mount the `/` partition of the existing OS. Open the `/etc/passwd` file on the mounted file system. Delete the password field from the root user, eg:
root:x:0:0:root:/root:/bin/bash
Delete `x` from the above. Save the file and reboot it. You are at the login prompt. Just give the root user and password (hit enter). You will be logged in as root. Just open the `/etc/passwd` file and put back the `x` there. You can use `passwd` to change the password.
Regards,
--
Prasanta
|
|
|
|
09-15-2009, 01:46 AM
|
#10
|
|
Member
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367
Rep:
|
@ prasanta how does your suggestion differ from my post #3 except that you are using a live cd instaed of being in single user mode..also you didnt mention anything about /etc/shadow. i have doubts with /etc/shadow file.
|
|
|
|
09-15-2009, 01:55 AM
|
#11
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
Quote:
Originally Posted by mobinskariya
then two users having same password should have same entry in the shadow file.. am i getting it right.. can that happen?i dont think so..
|
Exactly. even the same passwords are represented differently in shadow file. I just created a test user and assigned same password as mine and the shadow entry was different.
|
|
|
|
09-15-2009, 02:00 AM
|
#12
|
|
Member
Registered: Sep 2007
Location: Kerala, India
Distribution: ubuntu 10.04
Posts: 367
Rep:
|
if they were same then a root user can easily guess the users password if it is same as that of root(a big security flaw)..in linux we cant recover a password but change it(reason md5 hashing).. it is a good security option out there in linux.. i was sure about that because i have already studied it in Security In Computing..i think i made my point clear.
regards
mobin
|
|
|
|
09-15-2009, 02:24 AM
|
#13
|
|
Member
Registered: Mar 2005
Location: India
Distribution: Debian
Posts: 368
Rep:
|
Quote:
|
@ prasanta how does your suggestion differ from my post #3 except that you are using a live cd instaed of being in
|
Yes, the solution is similar. The replied was missed out inadvertently.
Regards,
--
Prasanta
|
|
|
|
09-16-2009, 06:18 AM
|
#14
|
|
LQ Newbie
Registered: Sep 2009
Location: bangalore,india
Distribution: RHEL5
Posts: 11
Original Poster
Rep:
|
hmm...........finally my password is resetted.........
thanks to linuxlover.chaitnya,strycnine,centosboy,mobinskariya,prasanta
for ur good response........
|
|
|
|
09-16-2009, 06:26 AM
|
#15
|
|
Senior Member
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,592
Rep: 
|
Quote:
Originally Posted by spdthespeed
hmm...........finally my password is resetted.........
thanks to linuxlover.chaitnya,strycnine,centosboy,mobinskariya,prasanta
for ur good response........
|
Nice to hear that. You could tell how you did that so that other newbies coming here for same issue could get help out of this.
Also if you think that your issue is solved, mark the thread as solved from thread tools.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:04 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|