Reset pam.d Modules

Nathan PriceNathan Price
2 min read

I managed to bork my pam.d configs to the point that I couldn't root or sudo to gain access to reset them. In my shame, I had to create a new install USB and chroot in. Thankfully I haven't figured out drive encryption yet or I may have been SOL, I haven't the foggiest idea. This is on arch btw.

Edit 9/9/22: just use cryptsetup open ... to decrypt the drive then follow this guide

Create and boot into an install USB

List all the available partitions
fdisk-l

Mount the root partition - guide
mount /dev/nvme1n1p3 /mnt

Copy the pam configs from the install USB to the broken system.
mkdir /mnt/pam.d
cp -R /etc/pam.d /mnt/pam.d

Root into the file system
arch-chroot /mnt

Backup the screwed-up pam configs to someplace convienty.
mv /etc/pam.d /home/User/Downloads

move the stock configs in mv /pam.d /etc/

Reboot and remove install USB

KDE will fail to load because its pam modules aren't in the stock pam.d folder. Hopefully, you can manage to un-bork those.

ctl +alt + F2 to exit to command line.

Login and head over to the borked files

cd Downloads/pam.d

Remove the edits from:

  • cron.d
  • ssdm
  • ssdm-greeter
  • sddm-autologin
  • kde

Move those configs back to the etc folder.
sudo cp sddm /etc/pam.d - etc

Delete the unnessesary configs used by the installer.
sudo rm vmtoolsd partimaged

Restart Xorg to login to the desktop (or restart) sudo kill -9 Xorg

Success?

0
Subscribe to my newsletter

Read articles from Nathan Price directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Nathan Price
Nathan Price