LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 08-13-2010, 10:32 AM   #1
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Rep: Reputation: 30
Question Yet another need to access a forgotten root password


Okay, I have read the other threads (nearly a dozen or so) and nothing of use has come from it. I have tried:
  1. booting into single user mode (using '1' and 'single' in my bootloader edits) and it still ends up kicking me to the 'myBox login:' prompt
  2. booting from a live-CD with no luck - seems my CD drive is hosed, or the system just won't boot the CD

This is a system I set up, literally, years ago, with no need to touch it. It was originally set up as a file server, running SAMBA. I am wanting to add CUPS to it, and possibly a web server if it will handle the load.

Currently, it is running Debian 4.0 without a GUI.

My next step, if I can't get into the root account, is to install a new OS (and try to salvage the file shares that exist). I just would rather keep the install that I have, but I need to hack/crack or change my root password.

Help???
 
Old 08-13-2010, 10:42 AM   #2
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Code:
but I need to hack/crack or change my root password.
I am not hacker/cracker.

edit grub at boot prompt -> edit kernel line and append "init=/bin/bash" and boot machine.
it will boot machine and give command prompt then you can change root password.

tested on ubuntu 10.4 and debian lenny.

hope this help.
 
1 members found this post helpful.
Old 08-13-2010, 10:56 AM   #3
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
Very cool - yet, I get the following prompt:
Code:
root@(none):/#
and when I attempt to change the password, I get
Code:
bash: passwd: command not found
and I've tried BOTH of the following, with the same result
Code:
root@(none):/# passwd

root@(none):/# passwd root
any other suggestions or ideas?

Last edited by gvaught; 08-13-2010 at 10:58 AM. Reason: more info
 
Old 08-13-2010, 11:00 AM   #4
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Give the full path of passwd command

Code:
/bin/passwd
/usr/bin/passwd
 
1 members found this post helpful.
Old 08-13-2010, 11:12 AM   #5
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
You are good, my friend, but this seems to be eluding both of us.

@ /bin there is no passwd
@ /usr there is no ./bin (or I can't see it in this mode)

The /bin directory has a limited (approx. 90) number of commands available.
The /usr directory is (as far as this mode is concerned) empty.

It seems that in order to access the directories I need, I need to be logged in as 'root@myBox' rather than 'root@(none)'.

Or my system is hosed and I just haven't been able to accept that, as yet.
 
Old 08-13-2010, 11:22 AM   #6
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
perhaps you need to mount your /usr directory before you get "passwd"?
 
1 members found this post helpful.
Old 08-13-2010, 11:30 AM   #7
gvaught
Member
 
Registered: Sep 2003
Location: MidWest
Distribution: Debian GNU/Linux 8 (jessie)
Posts: 199

Original Poster
Rep: Reputation: 30
@HasC -
excellent recommendation!!! Now I've gotten to /usr/bin - and can run the passwd command.

Issue is here is what I get:
Code:
root@(none):/usr/bin# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: Authentication token lock busy
passwd: password unchanged
Any ideas what that means or how to correct it?

Seriously, I want to thank you guys for taking the time to work with me.
 
Old 08-13-2010, 12:00 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
Can you edit /etc/sudoers in the mode you've gotten to by the init=/bin/bash mode? Perhaps you could create a new user and give that new user full sudo access. Then log in to that user and do a sudo passwd to change the root password.

But first, check that /var is mounted with write permission for "root." The "lock" may be being reported as busy because /var/lock is not writable.

Last edited by PTrenholme; 08-13-2010 at 12:02 PM.
 
1 members found this post helpful.
Old 08-13-2010, 12:52 PM   #9
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,636

Rep: Reputation: 473Reputation: 473Reputation: 473Reputation: 473Reputation: 473
gvaught,

Run a live CD. Try the trick:

Mount your old root drive. Edit /etc/passwd and add a new sudo user by editing /etc/sudoers

Reboot into the old debian and find out if you can log in as a new sudo user. If you can then you will be able to do anything there as root. BTW you may need to delete some cached lock files first.

Good luck.

Last edited by malekmustaq; 08-13-2010 at 12:54 PM.
 
0 members found this post helpful.
Old 08-13-2010, 04:40 PM   #10
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by malekmustaq View Post
gvaught,

Run a live CD.
The OP stated that he couldn't use a LiveCD
 
Old 08-13-2010, 06:59 PM   #11
SalmonEater
Member
 
Registered: Jun 2010
Location: Up the Big River w/o paddle
Distribution: Salent & Slackel
Posts: 131

Rep: Reputation: 19
HalC was getting you there;
Thanks to anticapitalista at anitX forums:

1. Append ‘init=/bin/bash’ {as done before}
2. Press Enter
3. Type mount -n -o remount,rw / (at prompt)
4. passwd
5. Follow steps to give yourself a new root password
5. reboot
 
Old 08-13-2010, 08:22 PM   #12
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: root
Distribution: Slackware & BSD
Posts: 1,636

Rep: Reputation: 473Reputation: 473Reputation: 473Reputation: 473Reputation: 473
Quote:
Quote:
Originally Posted by malekmustaq View Post
gvaught,

Run a live CD.
The OP stated that he couldn't use a LiveCD
Ooops!

Yes indeed. Sorry.

Either I was drowsy or I was sleeping when I made the post.

May you have luck.
 
Old 08-14-2010, 12:29 AM   #13
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 113Reputation: 113
Quote:
Issue is here is what I get:
Code:

root@(none):/usr/bin# passwd
Enter new UNIX password:
Retype new UNIX password:
passwd: Authentication token lock busy
passwd: password unchanged

Any ideas what that means or how to correct it?
Mount your ROOT filesystem as rw and try again.
 
Old 08-14-2010, 01:36 AM   #14
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
Hmm... For a system with physical access that would be a pretty easy way to... never mind . I think remounting the system as rw as SalmonEater has said will do the trick. Please don't forget to mark this as solved when you already find it correct.
 
Old 08-14-2010, 04:06 PM   #15
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Make sure the root filesystem is mounted read-write before running password:

mount -o remount,rw /

edit: oops sorry for the late reply ... I had an old version of the thread in my broswer cache,

Last edited by btmiller; 08-14-2010 at 04:07 PM. Reason: explain late reply
 
  


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
Forgotten root and Administrater's password s_mak Linux - Newbie 11 01-17-2006 06:48 AM
if the root password is forgotten..... AnimaSola Linux - Software 1 05-31-2005 10:12 PM
forgotten my root password, help amanjsingh Linux - Newbie 16 03-31-2004 09:41 PM
Forgotten my root password Blondie Linux - Newbie 2 12-08-2003 11:50 AM
Root Password FORGOTTEN kajensen Linux - Newbie 4 08-11-2003 02:06 AM


All times are GMT -5. The time now is 12:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration