使用mosh连接Linux服务器

2019-02-28  本文已影响0人  风吹我已散博客

一、简介

Mosh表示移动Shell(Mobile Shell),是一个用于从客户端跨互联网连接远程服务器的命令行工具。它能用于SSH连接,但是比Secure Shell功能更多。它是一个类似于SSH而带有更多功能的应用。程序最初由Keith Winstein编写,用于类Unix的操作系统中,发布于GNU GPL V3协议下。

Mosh最大的特点是基于UDP方式传输,支持在服务端创建一个临时的Key供客户端一次性连接,退出后失效;也支持通过SSH的配置进行认证,但数据传输本身还是自身的UDP方式。

Mosh的功能:

官方网站:https://mosh.org

二、安装

Linux平台

Windows客户端

建议使用Cygwin安装mosh:

C:\> setup.exe -q mobile-shell

MacOX

使用Homebrew OS X 10.5或更高版本安装:

brew install mosh

三、使用

客户端使用mosh连接服务器:

mosh root@172.16.1.1

如图所示:

mosh

四、语法

# mosh --help
Usage: /usr/bin/mosh [options] [--] [user@]host [command...]
        --client=PATH        mosh client on local machine
                                (default: "mosh-client")
        --server=COMMAND     mosh server on remote machine
                                (default: "mosh-server")

        --predict=adaptive      local echo for slower links [default]
-a      --predict=always        use local echo even on fast links
-n      --predict=never         never use local echo
        --predict=experimental  aggressively echo even when incorrect

-4      --family=inet        use IPv4 only
-6      --family=inet6       use IPv6 only
        --family=auto        autodetect network type for single-family hosts only
        --family=all         try all network types
        --family=prefer-inet use all network types, but try IPv4 first [default]
        --family=prefer-inet6 use all network types, but try IPv6 first
-p PORT[:PORT2]
        --port=PORT[:PORT2]  server-side UDP port or range
                                (No effect on server-side SSH port)
        --bind-server={ssh|any|IP}  ask the server to reply from an IP address
                                       (default: "ssh")

        --ssh=COMMAND        ssh command to run when setting up session
                                (example: "ssh -p 2222")
                                (default: "ssh")

        --no-ssh-pty         do not allocate a pseudo tty on ssh connection

        --no-init            do not send terminal initialization string

        --local              run mosh-server locally without using ssh

        --experimental-remote-ip=(local|remote|proxy)  select the method for
                             discovering the remote IP address to use for mosh
                             (default: "proxy")

        --help               this message
        --version            version and copyright information

Please report bugs to mosh-devel@mit.edu.
Mosh home page: https://mosh.org
上一篇 下一篇

猜你喜欢

热点阅读