wangduanduan / wangduanduan.github.io

Wubba Lubba dub-dub
https://wdd.js.org
27 stars 7 forks source link

mosh: 永不断线的ssh #219

Closed wangduanduan closed 5 years ago

wangduanduan commented 5 years ago

mosh (mobile shell)

受不了ssh换了网络就断线,可以试试mosh, 据说永不掉线。神器啊!

优点特点

缺点

// centos7
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/

# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
  exec sudo "$0" "$@"
fi

# install mosh
yum install -y epel-release
yum install -y mosh

# add firewall rules
firewall-cmd --zone=public --permanent --add-port=60000-61000/udp
firewall-cmd --reload

结论

如无必要,不要安装mosh。