安装 mosh
服务器和客户端都需要安装
sudo apt install mosh
开启防火墙
sudo ufw allow 60000:61000/udp
连接服务器
mosh root@10.10.0.1
Mosh的连接错误
The locale requested by LANG=C.UTF-8 isn't available here.
Running `locale-gen C.UTF-8' may be necessary.
The locale requested by LANG=en_US.UTF-8 isn't available here.
Running `locale-gen en_US.UTF-8' may be necessary.
mosh-server needs a UTF-8 native locale to run.
Unfortunately, the local environment (LANG=C.UTF-8) specifies
the character set "US-ASCII",
The client-supplied environment (LANG=en_US.UTF-8) specifies
the character set "US-ASCII".
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=zh_CN.UTF-8
LC_TIME=zh_CN.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=zh_CN.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=zh_CN.UTF-8
LC_NAME=zh_CN.UTF-8
LC_ADDRESS=zh_CN.UTF-8
LC_TELEPHONE=zh_CN.UTF-8
LC_MEASUREMENT=zh_CN.UTF-8
LC_IDENTIFICATION=zh_CN.UTF-8
LC_ALL=
Connection to xlxz.org closed.
/usr/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)
mosh-server needs a UTF-8 native locale to run
解决方案
LC_ALL="en_US.UTF-8" mosh root@xlxz.org