LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 08-24-2005, 07:32 AM   #1
fluppel
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Rep: Reputation: 0
tricky root password reset, selinux


Hi

I've run into a problem - my machine had to reboot and now there's always some fsck during bootup and it want's the root password, unfortunately I forgot that one... [no more comments on that :-(]

So I started first by booting knoppix and resetting the password in /etc/shadow, but the hd with /etc on it was not mountable?! (selinux problem?)

So I tried booting into single user mode with the following addition to the kernel line in grub:

selinux=0 init=/bin/bash

Then I got a bash, but the filesystem was mounted read-only so passwd and changing the shadow file was not possible.

What's going on? Could anyone help my resetting my password?

thx!
 
Old 08-24-2005, 08:24 AM   #2
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
I don't have SELinux enabled so I am unsure of why you are having such a difficult time resetting your root password. However, I do have another option for you to try. Most distributions include a way to boot in repair mode on their CD. You should also be able to try this method using the Knoppix CD.

After booting from a CD and you get a command line locate where the root partition of your hard drive has been mounted. If it isn't mounted then mount it. Once mounted you can issue the chroot command. So for example, if your root partition was mounted at /mnt/sysimage you would issue the command chroot /mnt/sysimage /bin/bash. At that point you can change the root password with passwd and it will make the change on your harddrive.

Bill
 
Old 08-24-2005, 08:49 AM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
But, if fsck tell you the file system is bad, you won't be able to mount it 'till you complete fsck. Which you can do from your rescue CD or Knoppix. (The drive should be mounted "ro" when you run fsck.)
 
Old 08-25-2005, 11:10 AM   #4
wmakowski
Member
 
Registered: Oct 2003
Location: Ohio
Distribution: Fedora 25, 26, RHL 5.2
Posts: 560

Rep: Reputation: 56
Good point, I sort of glanced over the original problem and went right to the root passwd issue. It would be best to run fsck on that filesystem before mounting it rw and using chroot.

Bill
 
Old 08-25-2005, 02:23 PM   #5
fluppel
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Original Poster
Rep: Reputation: 0
Hey guys thanks alot for your suggestions - I'll try it next week when I have physical access to my machine again.. (vacation now)
 
Old 09-07-2005, 11:07 AM   #6
fluppel
LQ Newbie
 
Registered: Nov 2003
Posts: 9

Original Poster
Rep: Reputation: 0
It's been a while..

I'm kind of stuck in a second dilemma:

Now I'm able to boot into single user mode and do the fsck on the corrupted ext3 filesystem - so far so good - then when I want to reboot I can't without switching the power off because init 0, shutdown -h now and reboot all say that initctl can't be found.
So after the power off I boot normally and again, the fsck appears.

Booting into knoppix works, but I can't mount the desired partition - I always get some superblock error. Any further help?
 
Old 09-07-2005, 06:11 PM   #7
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Try looking at dumpe2fs (when in single-user mode) to see what the superblock settings are, and then see if Knoppix can be teased into mounting the fs.

ddrescue can (in some cases) be used to copy a "bad" fs to another drive, and it can (should be) run from the /dev level, without mounting the fs.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
root password reset log cmsisb Red Hat 5 01-14-2013 04:49 PM
Reset Root password hbenway AIX 9 08-19-2008 04:13 PM
reset root password kapslock Debian 14 07-27-2006 07:08 AM
how do i stop root password reset? robhargreaves Linux - Security 3 01-31-2004 09:16 AM
Reset Root password sdsouza Linux - Software 5 11-12-2003 04:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

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