I'm trying to reset password to root account on Slackware server (with Intel Atom on Intel motherboard and two HDDs). There is software RAID set up (devices mounted during boot: md0 - /, md1 - /usr, md2 - /var, md3 - /tmp, md4 - /home).

What I tried (with LILO boot options):

  1. linux single: normal login prompt doesn't let me in without root password

  2. linux init=/bin/bash (with or without `rw' - no difference): I got prompt as user (none) - no access to passwd. After that I tried mounting the drives:

    mount /dev/md0 /mnt/sys
    mount /dev/md1 /mnt/sys/usr
    mount /dev/md2 /mnt/sys/var

    System let me use passwd and it looked as change was successful. After reboot I still couldn't log in. Effect was the same when I tried deleting the password in /etc/shadow.

  3. booting from live cd/usb (for chroot/passwd): System boots straight to the local system (I set in bios to boot from cd and/or usb drive). This seems to be the simplest option, if there is some way to make this system boot as it is set up in BIOS.

Any sugestions how can I proceed?

  • You only need to mount md0 after using init=/bin/bash and then open /etc/shadow. There, blank out the password field for root (it is colon separated). Sync, reboot then login as root with no password to a normally booted system. – caskey May 2 '15 at 9:37
  • @caskey I believe you mean /mnt/sys/etc/shadow – Cameron Kerr May 2 '15 at 12:19
  • you need chroot /mnt/sys and use the passwd from there to change the root password – c4f4t0r May 2 '15 at 12:44
  • @caskey I forgot to add that I also tried editing /etc/shadow. I could open the file and save it but after reboot there was still non-blank root password required. – Jan Kastor May 2 '15 at 19:29

After changing BIOS option to treat removable drives as fixed size I was able to boot from usb (seems it's a known problem with Intel D945GCLF board - http://ubuntuforums.org/showthread.php?t=1113472) and resync raid drives (raid1 array was working with only one disk).

I still couldn't log into root account (blanking/changing password had no effect, I didn't find where/how it's locked), but I managed to reset password and log with diffrent user with enough priviledge to su into root prompt.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.