在高延迟的网络下,Mosh 比 SSH 流畅多了,并且3G网络下,丢失网络变动IP后,终端链接不会中断。shell
brew install mobile-shell
网络
注: Server, Client 都须要安裝 mosh 才能够。ssh
经典用法ide
Mosh will log the user in via SSH, then start a connection on a UDP port between 60000 and 61000.spa
$ mosh chewbacca.norad.mil
code
Different usernameserver
$ mosh potus@ackbar.bls.gov
io
Server binary outside pathclass
$ mosh --server=/tmp/mosh-server r2d2
mobile
Selecting Mosh UDP port
$ mosh -p 1234 darth
Selecting SSH port
$ mosh --ssh="ssh -p 2222" figrindan