LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   cant login as root (https://www.linuxquestions.org/questions/slackware-14/cant-login-as-root-750670/)

bloodsugar 08-27-2009 11:58 AM

cant login as root
 
hello,

I've installed slack 12.2, and upgraded to the new kernel packages, but I didnt rebuild the initrd (!).

I reboot the machine, and get 'kernel panic'.

So I think I'll just get back in and fix it by using the slack dvd and

Code:

boot: hugesmp.s root=/dev/hda2 rdinit=ro
it works and I get to the login screen, but I cant login in with my root password, although I can login with my user. (I have been able to login as root before this).

is there anyway to get in as root without the password?

Chuck56 08-27-2009 12:06 PM

from single user mode (init 1) run "passwd" and change the password

[edit]
oops - that doesn't work...

you can follow this thread: http://www.linuxquestions.org/questi...ht=root+passwd
[/edit]

hua 08-27-2009 12:49 PM

Quote:

[edit]
oops - that doesn't work...:)
And when you are logged in as user can you do su?

gonzas 08-27-2009 01:00 PM

Have you tried the "init=/bin/bash" boot parameter?

If this gets you to bash prompt, you'll be "logged in" as root, and then you can change the password.

bgeddy 08-27-2009 01:17 PM

Quote:

is there anyway to get in as root without the password?
There are a few methods of doing this but I've only found one to work reliably. That is to boot using the Slackware install DVD. Make a mount directory "mkdir /mnt/root". Mount the installed Slackware hard disk,(lets say /dev/sda2), to the directory "mount /dev/sda2 /mnt/root". Chroot into the mounted directory with "chroot /mnt/root". Run "passwd". Reboot.

Other methods I have tried like tagging init=/bin/bash or single to the lilo prompt have problems for me. One is I can't get a lock on the password file when I try and write to it. The chroot seems to be the only reliable method.

bloodsugar 08-27-2009 02:27 PM

I followed the advice in this thread:

http://www.linuxquestions.org/questi...ht=root+passwd

particularly post #4, after following those instructions and bits of info from other posts, I then went into /hd/etc/shadow, and deleted the root password. I then rebooted using the slack 12.2 dvd with this:

boot: hugesmp.s root=/dev/hda2 rdinit=ro

and was able to login as root, and fix the inital problem.


I can eat my dinner now!

Thanks everyone :)


All times are GMT -5. The time now is 04:09 PM.