跳过正文
  1. Blogs/

Ubuntu Server 安装 Mosh

·321 字·1 分钟· ·
代码 Mosh Ubuntu Server Vps Ssh Mosh
作者
大大的小蜗牛
机会总是垂青于有准备的人!
目录

服务端安装 Mosh:

sudo apt install mosh

客户端安装 Mosh:

Ubuntu:

sudo apt install mosh

Ubuntu 上也可以安装 Termius ,也支持 Mosh 连接。当服务器比较多时,Termius 比自带终端方便统一管理。

手机端:

  • 安卓:JuiceSSH / Termux
  • iOS:Blink Shell

其他系统安装方式参考官网:

https://mosh.org/#getting

Mosh 通过 UDP 连接,服务端需要打开防火墙,开放 60001 端口,如果有多个连接,开放多个端口,如 60002

sudo iptables -I INPUT -p udp --dport 60001 -j ACCEPT

如果云服务器有安全组,同时需要去云服务商后台在安全组中开放端口。

Mosh 支持很多选项,可以用 mosh —help 看到:

mosh --help 

Mosh 的连接方法:

mosh USERNAME@IP

假设你的服务器 ip 是 114.114.114.114 ,用户名是 root

mosh root@114.114.114.114

如果你不想用默认的 60001 端口,可以用 -p 指定端口:

mosh -p 9527 root@114.114.114.114

如果你修改过默认的 SSH 登录端口,如把 22 改成了 22222

mosh --ssh="ssh -p 22222" root@114.114.114.114

Mosh 也支持 Google Authenticator 二步验证。

相关文章

SSH Google Authenticator
·323 字·1 分钟
代码 Ssh-Google-Authenticator Ubuntu Google Ssh Two Factor Authenticator
Ubuntu VPS 优化
·80 字·1 分钟
代码 Ubuntu-Vps-Optimized Ubuntu Vps 优化 主机 LNMP
修改 Ubuntu 状态栏托盘图标顺序
·398 字·1 分钟
代码 Ubuntu-System-Icon Ubuntu 图标 托盘 状态栏

加载Giscus评论,或者