解决办法:
1、在server上/etc/hosts文件中把你本机的ip和hostname加入
135.251.200.171 localhost.localdomain
2、在server上/etc/ssh/sshd_config文件中修改或加入UseDNS=no,另外在authentication gssapi-with-mic也有可能出现问题,在server上/etc/ssh/sshd_config文件中修改GSSAPIAuthentication no
UseDNS no
GSSAPIAuthentication no
3、在server上/etc/nsswitch.conf中修改hosts: files dns为hosts: files
#hosts: files dns
hosts: files
4、reboot server使配置生效
/etc/init.d/sshd restart重启sshd进程使配置生效。