On one of our RHEL6 servers I made a change to /etc/pam/d/system-auth and password-auth then after rebooting lost the ability to sudo and su. Specifically I changed this line:
auth sufficient pam_unix.so try_first_pass
auth optional pam_unix.so try_first_pass
I can still ssh to the server and get in with a standard user account however I have no rights to make any changes to any files so I can reverse this. This server is also a VM. Is there anything I can do? Any PAM tricks out there?