一:TCP over UDP
1、安裝mosh
yum install epel-release
yum install mosh
2、使用客戶端連接
mosh user@ip -p 60001
3、查看mosh的連接(默認UDP 60001端口,防火牆需放行)
netstat -unlp | grep mosh
二:純UDP連接
1、啟動mosh-server服務端
mosh-server new -c 256 -s -l LANG=en_US.UTF-8 -p 60000
顯示如下:
MOSH CONNECT 60000 3aaxFsHQzzL6pb35pDzC+Q mosh-server (mosh 1.3.0) [build mosh 1.3.0] Copyright 2012 Keith Winstein <mosh-devel@mit.edu> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
2、使用生成的key通過mosh-client連接
MOSH_KEY=9S9Bz/KDYVMNyiJg2267nw mosh-client ip 60000
備注:如果提示字符集問題,請在~/.bashrc中添加
export LANG=en_US.UTF-8 export LC_ALL=en_US.UTF-8
最后,推薦一個通過瀏覽器直接訪問終端的工具gotty(https://github.com/yudai/gotty)