LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-03-2004, 04:22 PM   #1
Rhatlinux
Member
 
Registered: Sep 2004
Distribution: Arch 0.7.1 (Noodle)
Posts: 128

Rep: Reputation: 15
forgot my root password help!


I forgot my root password and I tried rebooting and typing "linux init=/bin/bash" and logged in but when I type in passwd to change my root password, I get the following error message: "Couldn't lock password file: try again."
 
Old 10-03-2004, 04:34 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
run "init 1" instead of /bin/bash. if it is still failing, there is probably a stale lock file on it, e.g. /etc/passwd.lock. the last time i got hit by that, the lock file had a different name though... if it's not obvious, check /etc or /var for new files, which might be lockfiles (be careful though!)
 
Old 10-03-2004, 04:54 PM   #3
Rhatlinux
Member
 
Registered: Sep 2004
Distribution: Arch 0.7.1 (Noodle)
Posts: 128

Original Poster
Rep: Reputation: 15
I tried init 1 and it wanted a password for root. The /bin/bash logged me in without asking for a password but I can't do anything with the drive because it thinks it's read only and it's doing the password lock thing.
 
Old 10-03-2004, 05:05 PM   #4
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
Quote:
The /bin/bash logged me in without asking for a password but I can't do anything with the drive because it thinks it's read only and it's doing the password lock thing.
yea, you told the kernel to execute /bin/bash instead of init... so none of the init scripts have been ran, which just sucks for you

(ok, now heres the fun part, my default linux mounts the root partition as read only!, so remount it like so)

Code:
mount -o remount,rw /
that should give you read/write to the root partition
now im sure you can change the password from here

(isent linux security so easy to break when you can reboot the system )
 
Old 10-03-2004, 05:45 PM   #5
Rhatlinux
Member
 
Registered: Sep 2004
Distribution: Arch 0.7.1 (Noodle)
Posts: 128

Original Poster
Rep: Reputation: 15
Thanks. That works great!
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Forgot root password muru Linux - Security 5 09-26-2005 12:37 AM
forgot root password ali_hammad Linux - Newbie 3 03-09-2005 10:46 AM
forgot root password ali_hammad Linux - Security 4 03-08-2005 02:44 PM
Forgot root password Jay Smith Linux - Newbie 15 10-12-2004 06:23 PM
Forgot Root Password Ironpaws Linux - Software 6 07-03-2004 04:48 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 05:30 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