ssh连上后,发现敲命令延迟很大
解决方案:以下两个步骤都做一下
1、修改/etc/ssh/sshd_config配置文件,参考https://www.linuxidc.com/Linux/2013-07/86879.htm
#将其中的UseDNS一行的注释去掉,改为:
UseDNS no
#重启sshd
systemctl restart sshd
2、安装mosh替代ssh,参考https://mosh.org/#usage
先安装依赖包,否则后面会出现一大堆的问题
yum install autoreconf automake gcc protobuf protobuf-devel glibc-headers gcc-c++ ncurses-devel ncurses libncurses5-dev zlib libssl-dev openssl-devel
编译安装
$ git clone https://github.com/mobile-shell/mosh
$ cd mosh
$ ./autogen.sh
$ ./configure
$ make
# make install
使用
在本机下
mosh root@ip
做一下本地的ssh公钥验证,可以简化命令为
mosh localhost
效果
能较明显的解决延迟问题,但是仍然不是很令人满意