Posted the following mail to the ILUG today..

Hi Guys,

I have a RH 9 box that I look after, and I recently lost SSH access to said box. The only change that I can think would possibly cause the problem is that I ran RH’s up2date following their Security Advisory – RHSA-2003:222-08 (https://rhn.redhat.com/network/errata/errata_details.pxt?eid=1801), which updates the openssh package.

Following on from this, as I said I have been unable to ssh to the box remotely, but from the box itself, I am also unable to ssh to localhost from the machine itself.

To try and get around this I have upgraded openssh to the most recent package available, to no avail. I’ve tried setting sshd to listen on a different port to default, but again no use.

To which, David dorgan kindly pointed me towards /etc/pam.d/sshd, and sent me a copy of his file. I’ve included my original /etc/pam.d/sshd which didn’t work first, followed by David’s, which does work, and I still can’t figure out why.

  • #%PAM-1.0
    auth required pam_stack.so service=system-auth
    auth required pam_nologin.so
    account required pam_stack.so service=system-auth
    password required pam_stack.so service=system-auth
    session required pam_stack.so service=system-auth
    session required pam_limits.so
    session optional pam_console.so

  • auth required pam_nologin.so
    auth required pam_unix.so
    auth required pam_env.so # [1]
    account required pam_unix.so
    session required pam_unix.so
    session optional pam_lastlog.so # [1]
    session optional pam_motd.so # [1]
    session optional pam_mail.so standard noenv # [1]
    session required pam_limits.so
    password required pam_unix.so