diff -wpruN --no-dereference '--exclude=*.orig' a~/auth-pam.c a/auth-pam.c --- a~/auth-pam.c 1970-01-01 00:00:00 +++ a/auth-pam.c 1970-01-01 00:00:00 @@ -1241,12 +1241,19 @@ do_pam_setcred(void) sshpam_cred_established = 1; return; } + +#ifdef PAM_BUGFIX + /* Server will fatal out when pam_setcred() failed. */ + fatal("PAM: pam_setcred(): %s", pam_strerror(sshpam_handle, + sshpam_err)); +#else /* orig */ if (sshpam_authenticated) fatal("PAM: pam_setcred(): %s", pam_strerror(sshpam_handle, sshpam_err)); else debug("PAM: pam_setcred(): %s", pam_strerror(sshpam_handle, sshpam_err)); +#endif /* PAM_BUGFIX */ } #if 0 @@ -1345,10 +1352,16 @@ do_pam_session(struct ssh *ssh) if (sshpam_err == PAM_SUCCESS) sshpam_session_open = 1; else { +#ifdef PAM_BUGFIX + /* Server will fatal out when pam_open_session() failed */ + fatal("PAM: pam_open_session(): %s", + pam_strerror(sshpam_handle, sshpam_err)); +#else /* orig */ sshpam_session_open = 0; auth_restrict_session(ssh); error("PAM: pam_open_session(): %s", pam_strerror(sshpam_handle, sshpam_err)); +#endif /* PAM_BUGFIX */ } }