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

admin2年前IT技术1510

前几天更新了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 连接L2TP win7 连接L2TP遇到的问题

win10 连接L2TP win7 连接L2TP遇到的问题

PSK共享密钥文件位置/etc/ipsec.secretswin10无法链接的问题解决方案HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Se...

excel 批量粘贴图片的方法

1.e2是图片地址在表格下拉,批量输入="<table><img src="&e2&" height=100&nbs...

sql语句 REPLACE 区分大小写字母的

 REPLACE  sql语句 REPLACE 区分大小写字母的;要注意...

使用excel的翻译功能

使用excel的翻译功能

1.打开审阅2.打开翻译就可以实现翻译...

二维码生成导航

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

excel选取某个字符左边所有内容

=LEFT(C4,FIND("-",C4)-1)...

发表评论    

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