一个基于 SSH 用于链接远程 Unix/Linux 系统的工具 mosh

mosh

一、 什么是mosh

Remote terminal application that allowsroaming, supports intermittent connectivity, and provides intelligent local echo and line editing of user keystrokes.html

Mosh is a replacement for SSH. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links.python

Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, and Chrome. An iOS version is in testing.linux

Mosh 全名 Mobile Shell,是 MIT 推出的一个能够替代 SSH 的远程终端程序,适用于 GNU/Linux、FreeBSD、Solaris、Mac OS X 和 Android。它支持间断性链接,容许漫游,提供了本地回显和用户输入的行编辑。高延迟的网络下,Mosh 比 SSH 流畅多了,并且3G网络下,丢失网络变动IP后,终端链接不会中断。ubuntu

二、mosh有哪些功能

  • 它是一个支持漫游的远程终端程序。centos

  • 在全部主流的类 Unix 版本中可用,如 Linux、FreeBSD、Solaris、Mac OS X 和 Android。
  • 支持不稳定链接
  • 支持智能的本地回显
  • 支持用户输入的行编辑
  • 响应式设计及在 wifi、3G、长距离链接下的鲁棒性
  • 在 IP 改变后保持链接。它使用 UDP 代替 TCP(在 SSH 中使用),当链接被重置或者得到新的 IP 后 TCP 会超时,可是 UDP 仍然保持链接。
  • 在很长的时候以后恢复会话时仍然保持链接。
  • 没有网络延迟。当即显示用户输入和删除而没有延迟
  • 像 SSH 那样支持一些旧的方式登陆。
  • 包丢失处理机制

三、linux如何安装mosh

    3.1 centos上的安装

     

#yum install mosh -y

    3.2 ubuntu上的安装     

$ sudo apt-get install python-software-properties 
$ sudo add-apt-repository ppa:keithw/mosh 
$ sudo apt-get update $ sudo apt-get install mosh

四、其余平台如何安装mosh

    4.1 mac上的安装

#brew install mosh

   二、其余平台上安装 

    参考官网https://mosh.org/ 首页安全

五、如何使用mosh

5.1 安装bash

须要在服务器端安装mosh,同时在你的电脑也安装服务器

个人服务器是centos7 ,操做的电脑的mac网络

因此在服务器上使用yum install -y moshapp

在mac上使用brew intstall mosh

5.1远程登陆

$ mosh root@192.168.0.150

六、mosh优势

  • mosh 有额外的需求,好比须要容许 UDP 直接链接,这在 SSH 不须要。
  • 动态分配的端口范围是 60000-61000。第一个打开的端口是分配好的。每一个链接都须要一个端口。
  • 默认的端口分配是一个严重的安全问题,尤为是在生产环境中。
  • 支持 IPv6 链接,可是不支持 IPv6 漫游。
  • 不支持回滚
  • 不支持 X11 转发
  • 不支持 ssh-agent 转发

六、参考文章

http://www.68idc.cn/help/jiabenmake/qita/2014022369776.html

https://linux.cn/article-6262-1.html

相关文章
相关标签/搜索