LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 11-09-2003, 04:32 AM   #1
eddacker
LQ Newbie
 
Registered: Nov 2003
Location: Derbyshire, UK
Distribution: Debian Testing
Posts: 14

Rep: Reputation: 0
lost root password questionS


Hello
My problem is I seem to lose my root password and can only login as root by a re-boot.

I own the complete RH 7.1 and could easily re-install. For many reasons I do not want to do this! I have upgraded the kernal to 7.3 and added programs and such. Plus re-booting IMHO (and re-installing) is not a grand solution.

I think that this is a problem deeper in the user admin area of the o/s in that some profiles or something 'sees' different passwords?
and rebooting is this newbie's only way to get them 'cleared' back to the newest one.
====the story
This is a stand-alone dualboot machine I am using to teach myself Linux. It is basically a workstation with internet, no security issues, just a "classroom".

One day I was logged in as a user (eddacker) and needed to su and my password failed. I can't login as root, but all my users and their passwords are still good.

I seemed to have lost my 'root' password???

So I use my boot disk, login as root and go to passwd/shadow; wipe out the hash and reboot. I enter a new root password and because I am pendantic it is a secure one.

And it works fine, until (sometimes) when I am logged on as my default (or other) user and need to switch to root and then the password doesn't work?? sometimes. If I reboot it always works. I can login as root and switch to a user and back to su and a user and then -- it fails -- login incorrect, as if I have entered a bad password. argghhhh

======the question
What I am asking is complicated so I have no idea how to ask it other than "what is going on?" Why does my root passwd work on re-boot, but fails when switching users?
TIA
eddacker
 
Old 11-09-2003, 10:35 AM   #2
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
Quote:
So I use my boot disk, login as root and go to passwd/shadow; wipe out the hash and reboot.
Ok. Did you delete everything in /etc/passwd and /etc/shadow
or just the line for the root user ?


Next time, when you forget your root password, you can always boot Linux in Single User mode (runlevel 1).

RedHat 7.1 - Booting Single-User Mode
http://www.redhat.com/docs/manuals/l...CS-RESCUE-MODE

RedHat 7.3 - Booting Single-User Mode
http://www.redhat.com/docs/manuals/l...ng-single.html
 
Old 11-09-2003, 10:58 AM   #3
eddacker
LQ Newbie
 
Registered: Nov 2003
Location: Derbyshire, UK
Distribution: Debian Testing
Posts: 14

Original Poster
Rep: Reputation: 0
ahh, ha!
no I did not. And I am such a newbie I did not know I could [cntrl] X and boot: single
so I have learned. I will try the delete everything in /etc/passwd and /etc/shadow and see how that goes )
but this is a great journey, thank you for your reply.
eddacker
 
Old 11-09-2003, 11:03 AM   #4
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
NO
Do NOT delete the contents of /etc/passwd and /etc/shadow

I was asking a question, not giving instructions...


My post should have looked like this:
Quote:
In /etc/passwd and /etc/shadow, did you delete everything or just the line for the root user ?

Last edited by Mathieu; 11-09-2003 at 11:07 AM.
 
Old 11-09-2003, 11:10 AM   #5
eddacker
LQ Newbie
 
Registered: Nov 2003
Location: Derbyshire, UK
Distribution: Debian Testing
Posts: 14

Original Poster
Rep: Reputation: 0
Hey! **grins**
this is a stand-alone machine, I am root and all the users.
or is there some other danger in deleting everything in passwd and shadow?
and is that why I am getting such inconsistant results, with my root password working on reboot and then not?
 
Old 11-09-2003, 11:39 AM   #6
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
If you take a look at /etc/passwd, you will notice many users such as xfs, halt, mail, etc.
These system users are required by the various Linux daemons (programs).
Deleting them will causes problems.

Try resetting the passwords for root and the normal users (the ones you created) using the passwd command.
 
Old 11-10-2003, 05:13 AM   #7
Ian Macfarlane
LQ Newbie
 
Registered: Nov 2003
Location: Hull, UK
Posts: 1

Rep: Reputation: 0
Using Mandrake 9.1 and trying to change the root password (because I cannot remember it) I have used the CD1 and at the root@rescue prompt I find that there is not a passwd command. Please help a Newbie!
 
Old 11-10-2003, 06:00 AM   #8
iceman47
Senior Member
 
Registered: Oct 2002
Location: Belgium
Distribution: Debian, Free/OpenBSD
Posts: 1,123

Rep: Reputation: 47
try whereis passwd, I bet the PATH wariable isn't set.
So most likely, it'll be in /usr/bin/passwd.
 
Old 11-11-2003, 05:10 PM   #9
nfixit
LQ Newbie
 
Registered: May 2003
Posts: 3

Rep: Reputation: 0
???

I also forgotten my password, but could not understand how do you set a new one(I don't know any linux commands so bear with me please). Will it be better if I just reinstall linux? I would rather not. Please help and remember I know nothing about linux (Iam a windows user)

Nfixit
 
Old 11-11-2003, 06:40 PM   #10
Mathieu
Senior Member
 
Registered: Feb 2001
Location: Montreal, Quebec, Canada
Distribution: RedHat, Fedora, CentOS, SUSE
Posts: 1,403

Rep: Reputation: 46
To reset your root password, you will need to boot linux in single-user mode.
To do this, read this document.
http://www.redhat.com/docs/manuals/l...ng-single.html

Once the system is booted, use the passwd command by typing:
Code:
/usr/bin/passwd
 
  


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
Lost Root password Oakstaff Linux - Newbie 6 11-29-2006 04:03 AM
Lost root password amirdhagopal Suse/Novell 13 02-10-2005 12:09 AM
lost root password papitu76 Mandriva 12 10-31-2004 10:40 AM
lost root password brandonAd Linux - Security 7 08-03-2003 03:23 AM
lost root password dvong3 Linux - Newbie 2 06-13-2003 09:34 AM


All times are GMT -5. The time now is 06:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration