jwenjian / ghiblog

GitHub Issues Blog, powered by GitHub Issues and GitHub Actions

Home Page:https://1link.fun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

解决: ssh 远程登录虚拟机 Linux 速度很慢的问题

jwenjian opened this issue · comments

主机: Win7
虚拟机: CentOS7
虚拟机管理软件: VirtualBox
网络设置: NAT网络, 映射虚拟机内 22 端口到本机 22 端口
现象: 从主机(Win7) 用 putty, winSCP 等软件远程连接 CentOS7 时, 速度很慢或无法远程登录


解决方案:

  1. 在 CentOS7 中, 执行sudo vi /etc/ssh/sshd_config
  2. 在 vi 中, 将注释掉的 #UseDNS=yes 改为 UseDNS=no
  3. 重启 CentOS7 即可

不需要重启 CentOS 7(这太暴力了
执行下面的命令:

sudo service sshd restart

即可。