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

然后重启。

相关推荐
brucelee1865 分钟前
Claude Code 安装教程(Windows / Linux / macOS)
linux·windows·macos
jsons132 分钟前
给每台虚拟机设置独立控制台密码
linux·运维·服务器
嵌入式×边缘AI:打怪升级日志1 小时前
全志T113 Tina-SDK 配套工具链开发应用(从Makefile到CMake再到Autotools)
linux
嵌入式×边缘AI:打怪升级日志1 小时前
全志T113嵌入式Linux开发环境搭建(VMware + Ubuntu 18.04)详细步骤
linux·ubuntu
云栖梦泽2 小时前
Linux内核与驱动:14.SPI子系统
linux·运维·服务器·c++
yipiantian2 小时前
在Claude项目中实现跨目录访问Skills
linux·运维·服务器
cen__y3 小时前
Linux07(信号01)
linux·运维·服务器·c语言·开发语言
MT5开发3 小时前
Linux安装MariaDB
linux·运维·mariadb
Lentou3 小时前
日志轮询策略
linux·服务器·网络
Yoyo25年秋招冲冲冲4 小时前
【亲测可用】ubuntu系统下安装Openclaw+配置飞书
linux·ubuntu·ai·飞书·openclaw