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

然后重启。

相关推荐
C_心欲无痕17 小时前
ts - tsconfig.json配置讲解
linux·前端·ubuntu·typescript·json
冰西瓜60018 小时前
国科大2025操作系统高级教程期末回忆版
linux
HIT_Weston19 小时前
93、【Ubuntu】【Hugo】搭建私人博客:面包屑(一)
linux·运维·ubuntu
cuijiecheng201819 小时前
Linux下Beyond Compare过期
linux·运维·服务器
HIT_Weston19 小时前
92、【Ubuntu】【Hugo】搭建私人博客:侧边导航栏(六)
linux·运维·ubuntu
CodeAllen嵌入式19 小时前
Windows 11 本地安装 WSL 支持 Ubuntu 24.04 完整指南
linux·运维·ubuntu
码农小韩21 小时前
基于Linux的C++学习——指针
linux·开发语言·c++·学习·算法
wdfk_prog21 小时前
[Linux]学习笔记系列 -- [fs]seq_file
linux·笔记·学习
Jay Chou why did21 小时前
wsl安装完无法进入wsl
linux
石头5301 天前
Rocky Linux 9.6 docker k8s v1.23.17 kubeadm 高可用部署文档
linux