主要是为了不用老是被断开,大大延长了ssh的可用时间;不用特别付出就可以实现ssh + screen的效果。
值得一试。
Contents
hide
参考文献
安装
服务器端 –
Shell
xxxxxxxxxx
5
1
apt install mosh
2
# 还要改一下Locale, 不然客户端登陆有可能会出现这样的错误
3
locale-gen "en_US.UTF-8" && echo -e 'LANG=en_US.UTF-8\nLC_ALL=en_US.UTF-8' >> /etc/environment
4
# check 一下
5
tail /etc/environment
客户端
Shell
xxxxxxxxxx
4
1
# Mac
2
brew install mosh
3
# Android,下载JuiceSSH.
4
# Apple, Blink or Terminus.
使用
Shell
xxxxxxxxxx
6
1
# 使用老的ssh key设置,这样不用输密码
2
mosh --ssh="ssh -p [ssh_port]" root@[server_ip]
3
# 如果出现mosh_server找不到的情况,再试试
4
mosh --ssh="ssh -p [ssh_port]" --server=/usr/bin/mosh-server root@[server_ip]
5
6
ufw allow 60000:61000/udp