Centos 7 ssh连接速度慢(耗时20秒+)

作系统:centos7.9

现象突然间通过 ssh、xshell等客户端工具连接时,连接速度缓慢,需要耗时20秒左右才能连接上

排查思路:

1. 查看操作系统日志

复制代码
	从系统日志里看到较多的错误,这个可能是一个bug (现象类似,但是日志并不完全一样)

参考redhat 官方的方案: https://access.redhat.com/solutions/3900301


3. 解决方案

从redhat 官网介绍看该问题和使用nsswitch.conf 里使用NIS 有关, 可以按照redhat 提供的方案试一下

/usr/lib/systemd/system/rpcbind.socket as /etc/systemd/system/rpcbind.socket (可要可不可要哦)

编辑这个文件 (如果没有文件则创建)

/etc/systemd/system/rpcbind.socket

编辑后内容如下(建议直接复制)

bash 复制代码
[Unit]
Description=RPCbind Server Activation Socket

[Socket]
ListenStream=/var/run/rpcbind.sock

# RPC netconfig can't handle ipv6/ipv4 dual sockets
# Workaround for RHBZ 1531486
#BindIPv6Only=ipv6-only
#ListenStream=0.0.0.0:111
#ListenDatagram=0.0.0.0:111
#ListenStream=[::]:111
#ListenDatagram=[::]:111

[Install]
WantedBy=sockets.target

保存后执行 systemctl daemon-reload

然后重启。

相关推荐
BestOrNothing_201542 分钟前
(2)联想拯救者安装 Ubuntu 双系统前的 BIOS 设置全过程
linux·bios·拯救者·ubuntu22.04·联想lenovo
23.1 小时前
【Linux】grep命令终极指南
linux
巨斧空间掌门1 小时前
JDK17 下载 windows Linux
linux·运维·服务器
AI+程序员在路上1 小时前
CANopen 协议:介绍、调试命令与应用
linux·c语言·开发语言·网络
learndiary2 小时前
2026.03.12~2026.03.19制作的共7个视频及简介
linux·视频·学习日记小店
JiMoKuangXiangQu2 小时前
Linux:ARM64 中断处理简析
linux·arm64 中断
小生不才yz2 小时前
【Makefile 专家之路 | 函数篇】11. 终极奥义:eval 函数——动态生成规则的“核武器”
linux
皮卡蛋炒饭.2 小时前
进程得控制
linux·运维·服务器
YMWM_3 小时前
Install pyrealsense2 on the jetson thor
linux·realsense2
BestOrNothing_20154 小时前
(3)Ubuntu 22.04 双系统安装全过程记录
linux·ubuntu22.04·双系统安装