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

admin2年前IT技术1105

前几天更新了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 no
UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none


复制代码
# 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

 

   

               


相关文章

系统激活

win10激活 slmgr /skms kms.03k.orgslmgr.vbs -ato        计算机\HKEY_LOCAL_MACHINE...

虾苗

  (1)虾苗要规格整齐规格不整齐的虾投放后,在养殖中后 期不仅会出现大虾欺小虾现象,而且由于大小虾蜕壳很不整齐, 易导致自相残食。稚虾规格要求在0.8厘米以上,幼虾个...

php – DOMXpath – 获取一个元素的href属性和文本值[转]

原文https://stackoverflow.com/questions/6820429/domxpath-get-href-attribute-and-text-value-of-an-a-ele...

搭建apache2.4+php5.6环境

工具下载地址apache2.4 下载地址:http://httpd.apache.org/php5.6 下载地址:http://windows.php.net/download#php-5.6一、安装...

adobe验证屏蔽

127.0.0.1 lmlicenses.wip4.adobe.com  127.0.0.1 lm.licenses.adobe.com  127.0.0.1...

二维码生成导航

http://twoyn.shengmake.nethttp://twalabo.shengmake.nethttp://twyilang.shengmake.nethttp://twyindu.sh...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。