本来ssh连接很快的,加了iptables脚本之后就登陆很慢,来回开启关闭iptables进行测试,确定是iptables引起的。

修改/etc/ssh/sshd.config,重启sshd 后解决

sed -i  -e  "s/#UseDNS yes/UseDNS no/" /etc/ssh/sshd_config

service sshd restart