0

I made a mistake that resulted in the deletion of /etc/pam.d, how do I restore the PAM configuration to the state that would be generated for my currently installed packages when I don't know the specific files to restore?

1 Answers1

4

Use dpkg -S /etc/pam.d/* to find out which packages installed PAM files/services, then use apt to reinstall those packages and tell it to also install missing configuration files:

$ sudo apt install --reinstall -o Dpkg::Options::="--force-confmiss" $(dpkg -S /etc/pam.d/\* | cut -d ':' -f 1)

Thanks to @alvin-row for the bit on how to tell apt to install missing configuration files