apt-get install mosh
brew install mosh
mosh username@ip
– 指定端口
mosh --ssh="ssh -p 3122" root@ip
# netstat -anp | grep mosh
udp 0 0 :60001 0.0.0.0:* 2979085/mosh-server
udp 0 0 :60002 0.0.0.0:* 2979217/mosh-server
ssh-copy-id -p 3122 root@vpsip
cat ~/.ssh/config
Host cloud
HostName vpsip
Port 22
User root
ForwardAgent yes
ssh cloud
mosh cloud
# netstat -anp | grep mosh
udp 0 768 :60001 0.0.0.0:* 2592/mosh-server
iTerm2 创建窗口
mosh cloud