在高延遲的網絡下,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