汇成软件 Create the world!!!

centos7 通过ssh 登入系统慢的解决方法

前几天更新了centos7 ( 树莓派3b+硬件环境),发现 ssh登入时间很长,还以为sd 卡出现故障。通过排查不是硬件故障。而是由于ssh的配置文件开启了UseDNS功能 。服务器会先根据客户端的 IP地址进行 DNS PTR反向查询出客户端的主机名,然后根据查询出的客户端主机名进行DNS正向A记录查询,并验证是否与原始 IP地址一致,通过此种措施来防止客户端欺骗。

   1.通过修改服务器端配置文件 vim /etc/ssh/sshd_config (需要管理员权限)

复制代码
# vim /etc/ssh/sshd_config#Compression delayed#ClientAliveInterval 0#ClientAliveCountMax 3#ShowPatchLevel noUseDNS no#PidFile /var/run/sshd.pid#MaxStartups 10:30:100#PermitTunnel no#ChrootDirectory none
复制代码

添加或修改为 UseDNS no 

 

2.重启 ssh  服务:

   

root# service sshd restart

 

   

               


作者:admin 分类:IT技术 浏览:185 评论:0
留言列表
发表评论
来宾的头像