OpenSSH 4.0 fails to establish the connection with the client when UsePAM and UseLogin is set to Yes in sshd_config. But it works when usepam is 'no'.
Created attachment 890 [details] Don't check pam_session_is_open if UseLogin=yes When UseLogin=yes and UsePAM=yes, do_setusercontext (and thus do_pam_session) don't get called. This causes the session to close immediately because the PAM session isn't open. The attached patch fixes this.
Michael reports that the patch solved the issue, so patch applied. Thanks for the report.
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.