1、在server上/etc/hosts文件中把你本机的ip和hostname加入 
2、在server上/etc/ssh/sshd_config文件中修改或加入UseDNS=no 
3、注释掉server上/etc/resolv.conf中不使用的IP所有行 
4、修改server上/etc/nsswitch.conf中hosts为hosts:files
5、authentication gssapi-with-mic也有可能出现问题,在server上/etc/ssh/sshd_config文件中修改 GSSAPIAuthentication no。/etc/init.d/sshd restart重启sshd进程使配置生效。
如之前为服务器配置了双网卡,使的在/etc/resolv.conf文件中多了一行目前不使用的IP地址。注释或者删除该行即可。大多数情况修改1和5两项即可解决问题