2

I recently changed some pamd settings because I wanted my ssh keys unlocked at login. I followed the instructions at this wiki page.

Ignoring the warning, I have become locked out (cannot log in with user account or even root also in safe mode).

How can this be fixed? I have a live CD for arch linux, but I`m hoping a reinstall is not necessary.

4
  • Boot from live CD. Mount your root partition (e.g. mount /dev/sda2 /mnt). Edit PAM configs under /mnt/etc/pam.d). Commented May 13, 2012 at 16:36
  • heh that easy! why do we go trough all the trouble of securing our pc's. Let's hope this works. Commented May 13, 2012 at 16:41
  • Many of us go through loads of trouble securing computers physically too, because once someone has physical access to the console, much of logical security is largely irrelevant. But it's still a whole lot easier to do it over the network than to travel to your location with a large hammer (or a rescue CD and bad intentions). :) Commented May 13, 2012 at 16:57
  • This is why system encryption (i.e. encrypting the root file system) is important. Commented May 13, 2012 at 17:08

1 Answer 1

2

This can be fixed with a CD as Mikel suggested, but you can also do this without a CD.

  1. You can pass init=/bin/sh as an argument to the kernel (in the bootloader) to launch a shell.
  2. Once you have the shell, do mount -o remount,rw / to remount the root filesystem read/write.
  3. Edit the pam config to fix the issue.
  4. Reboot

Note this procedure is dependent upon your distribution. If you have a distribution which ships with a special initramfs, then init=/bin/sh might not work. In this case you should look up how to get a rescue shell in the initramfs (in your distro's documentation).

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.