LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-01-2010, 03:22 AM   #1
warlynx
LQ Newbie
 
Registered: Aug 2010
Location: Pretoria
Posts: 1

Rep: Reputation: 0
root password recovery - Suse 10.2.1


Hope you can help

Short version:

Ex employee logged into to box and changed the root password, trued to start in single user mode, but not coming right

Long version:

* Loaded up grub
* Typed the following in Boot Options:
init=/bin/sh
* Takes me to a prompt where I then enter the command "passwd"
* Returns with a "command could not be found" output

Tried changing the directories to /usr/bin and /sbin but didn't work either, any ideas?
 
Old 09-01-2010, 09:27 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,689

Rep: Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972Reputation: 7972
Quote:
Originally Posted by warlynx View Post
Hope you can help
Short version:

Ex employee logged into to box and changed the root password, trued to start in single user mode, but not coming right

Long version:

* Loaded up grub
* Typed the following in Boot Options:
init=/bin/sh
* Takes me to a prompt where I then enter the command "passwd"
* Returns with a "command could not be found" output

Tried changing the directories to /usr/bin and /sbin but didn't work either, any ideas?
Not sure what you mean by "not coming right", but instead of going through Grub, boot from your CD/DVD media. Go into "Rescue" mode. From there, you'll be able to mount the hard drive. You can try to run the "passwd" command from there (you'll be in as root at that point), or you can manually edit the /etc/shadow file, and remove the password for root.

And alternative is to find said ex-employee, and threaten them with bodily harm, until they tell you the password.
 
Old 09-01-2010, 11:38 AM   #3
tracertong
Member
 
Registered: Jun 2010
Posts: 34

Rep: Reputation: 16
First things first, I'd specify
Code:
init=/bin/bash
...as the shell. Be explicit. the system knows very little about itself at this stage.

That gives you a shell, and virtually nothing else, but the filesystem is still mounted read-only. So, next do this:
Code:
mount -o remount,rw /
That remounts the filesystem read/write.

Now
Code:
passwd
Set you password, and (important) remount as read-only:
Code:
mount -o remount,rw /
Hit the reset button.

Last edited by tracertong; 09-01-2010 at 11:39 AM.
 
Old 09-01-2010, 05:59 PM   #4
Andrew Benton
Senior Member
 
Registered: Aug 2003
Location: Birkenhead/Britain
Distribution: Linux From Scratch
Posts: 2,073

Rep: Reputation: 64
Another option is to boot with a live cd, mount the partition your system is on in a folder somewhere and then chroot into it.
Quote:
Originally Posted by warlynx View Post
* Loaded up grub
* Typed the following in Boot Options:
init=/bin/sh
* Takes me to a prompt where I then enter the command "passwd"
* Returns with a "command could not be found" output
That suggests that /usr is on a separate partition that has not been mounted. Mount everything in /etc/fstab with mount -a
 
  


Reply

Tags
boot, grub, options, password, recovery, root, suse



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
Password Recovery in Edubuntu 7.04 - In Terminal, Root Login : su , password : ????? farhannaeem13 Linux - Security 3 11-30-2007 09:59 AM
Root password recovery Jabber Linux - Security 6 11-27-2005 04:23 PM
Root Password Recovery ? Pravat Linux - Security 1 04-24-2005 04:46 AM
Password Recovery (not root) NewbGhostShells Linux - Newbie 3 12-17-2003 03:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:52 PM.

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