If a PAM module is being used to substitute a user during SSH authentication, it's possible that the SSH server is still using the old user name because of how the PAM configuration is set up.
The SSH server, by default, uses the user name that's provided by the client during the authentication process. If the PAM module is set up to substitute the user but the SSH server is still using the old user name, it could be due to one of the following reasons:
- Old user name is stored in the authentication token: Depending on how the PAM module is configured, it might be storing the old user name in the authentication token that's sent to the SSH server. In this case, the SSH server would still use the old user name, even though the PAM module has substituted the user.
- Incorrect PAM configuration: The PAM configuration might not be set up correctly to use the new user name. For example, the PAM configuration might not have been updated to use the new user name in the authentication token or might not be properly set up to handle the substitution of users.
- Issues with the PAM module: There might be a bug or issue with the PAM module itself that's preventing it from properly substituting the user and sending the new user name to the SSH server.
To resolve this issue, you might need to check the PAM configuration and make sure it's set up correctly to use the new user name. You might also need to check the PAM module for any potential issues. If the issue persists, it might be helpful to seek assistance from a system administrator or a developer familiar with PAM and SSH authentication.