In my Centos 7 machine, and as an inexplicable mistake, I ran:
rm /etc/pam.d/system-auth
Now, my system won't boot up, the network does not work, and in a few words, the system is trashed.
I tried to fix the problem with single user mode and running
ln -s /etc/pam.d/system-auth-ac /etc/pam.d/system-auth
This did not make any change and, after rebooting, my system is still not working.
The only solution that I found involves restoring the symlink from emergency mode, the challenge is, that emergency mode requires the root password which I don't have, and I don't seem to be able to change it from single user mode.
Steps to reproduce:
In a new CentOS installation:
• sudo rm /etc/pam.d/system-auth
• Restart
• You will notice that the system won't reach the login page(if Gnome or KDE are enabled). Otherwise, you will reach the login page but it won't work even if you have the right credentials.
Error I received I tried to login in emergency mode after I changed the root password in single user mode.
Steps trying to fix it :
• Enter single user mode enabling it with rw init=/bin/bash
• ln -s /etc/pam.d/system-auth-ac /etc/pam.d/system-auth
Thank you