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?
Asked
Active
Viewed 1.4k times
0
Ross Patterson
- 167
1 Answers
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
Ross Patterson
- 167