PuTTY doesn't set LANG
The locale you have set in PuTTY is completely decoupled from the environment variables on the system. To quote its documentation:
Unfortunately, there is no satisfactory mechanism for PuTTY and the server to communicate this information, so it must usually be manually configured.
Before PuTTY changed the default character encoding to UTF-8, it was an extremely common scenario for the OS to have settings defaulting to a UTF-8 enabled locale (typically en_US.UTF-8
) with PuTTY misinterpreting that by its own ISO-8859-1:1998
default.
PAM is more than just authentication
More than likely you've turned UsePAM
to no, not realizing that this turns off far more than just PAM authentication. The operative words from the sshd_config
manpage are:
Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types.
Your console logins are still invoking PAM modules associated with the account
and session
facilities, but your SSH logins are no longer doing so. I recommend that you re-enable PAM. At this point you can disable PasswordAuthentication
and ChallengeResponseAuthentication
if your goal is to require key based authentication. (which has always bypassed PAM's auth
facility)