Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.)
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.
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?
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.