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

admin2年前IT技术1353

前几天更新了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

 

   

               


相关文章

国内较大的游戏平台

37\贪玩\悦玩\4399...

关于jquery升级至1.8版本之后的兼容问题Uncaught TypeError: $(...).size is not a function

关于jquery升级至1.8版本之后的兼容问题Uncaught TypeError: $(...).size is not a function

之前也遇到过这种问题Uncaught TypeError: $(...).size is not a function  控制台报错如上图,打开Frame.js可以看到里面定义大小...

yt-dlp+ffmpeg

1. 安装Python和ffmpegPython:安装时把pip和添加系统环境变量都选上ffmpeg:下载好exe文件,把目录添加到系统环境变量就行2. 安装yt-dlppip install yt-...

ubuntu 远程连接 22 端口

安装OpenSSHUbuntu缺省没有安装SSH Server,使用以下命令安装:sudo apt-get install openssh-server openssh-client不过Ubuntu缺...

magento性能优化的教程

Magento是一套专业开源的电子商务系统,Magento设计得非常灵活,具有模块化架构体系和丰富的功能但有朋友会发现此模块用到了会发现非常的缓慢了,那么下面我们来看关于magento性能优化的例子。...

dell G15游侠重装系统

https://www.dell.com/support/kbdoc/zh-cn/000176966/%E5%A6%82%E4%BD%95%E5%9C%A8%E6%88%B4%E5%B0%94%E8%...

发表评论    

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