Great question — answering as the UphillTech team:
I'm no PAM expert, but that would probably be happening because the pam_unix authentication module (local user database: /etc/password and /etc/shadow ) is being consulted before the pam_winbind module (Samba/Active Directory). I am looking at the auth lines in your /etc/pam.d/system-auth , and assuming that system-auth is connected to password-auth (which /etc/pam.d/sshd references). When logging in as an AD user, pam_unix would not find the user locally, and so PAM would log an authentication failure for that module. Because pam_unix is marked as sufficient , not finding the user locally isn't considered a complete failure, and so PAM advances to the next module, eventually reaching...
Full answer by tangle: https://unix.stackexchange.com/a/674949 (CC BY-SA 4.0).
Need it done for your business? UphillTech.