I have a very interesting situation. I have a server running CentOS5.5, and whenever I try to ssh in using any external interface, there is a 4+ second delay, consistently. There is no such delay whenever I use the internal interfaces. For example, ssh'ing into mycomputer1 from mycomputer2 has little delay, but ssh'ing into mycomputer1.com from mycomputer2 goes to the external interface, where the lag occurs. /var/log/messages shows this when logging in with a password, with some redactions:
Mar 18 10:18:06 somecomputer sshd[788]: pam_unix(sshd:auth): authentication failure;
Mar 18 10:18:06 somecomputer sshd[788]: pam_krb5[788]: TGT verified using key for ...
Mar 18 10:18:06 somecomputer sshd[788]: pam_krb5[788]: authentication succeeds for user
Mar 18 10:18:12 somecomputer sshd[788]: Accepted password for user from computer port myport ssh2
Mar 18 10:18:13 somecomputer sshd[788]: pam_unix(sshd:session): session opened for user myuser by (uid=0)
Here's /etc/pam.d/sshd:
auth include system-auth
account required pam_nologin.so
account include system-auth
password include system-auth
session optional pam_keyinit.so force revoke
session include system-auth
session required pam_loginuid.so
session required pam_limits.so
Here's system-auth:
auth required pam_env.so
auth sufficient pam_unix.so likeauth nullok
auth sufficient pam_krb5.so use_first_pass
auth required pam_deny.so
account required pam_unix.so broken_shadow
account sufficient pam_succeed_if.so uid < 100 quiet
account [default=bad success=ok user_unknown=ignore] pam_krb5.so
account required pam_permit.so
password requisite pam_cracklib.so retry=3
password sufficient pam_krb5.so use_authtok
password sufficient pam_unix.so nullok use_authtok md5 shadow
password required pam_deny.so
session required pam_limits.so
session required pam_unix.so
session required pam_krb5.so use_first_pass