Skip to content

Instantly share code, notes, and snippets.

@goldeneggg
Created July 4, 2014 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldeneggg/2ab8ce45550ae642e00f to your computer and use it in GitHub Desktop.
Save goldeneggg/2ab8ce45550ae642e00f to your computer and use it in GitHub Desktop.
Getting started Mosh (Conncting from Mac to Linux Server)

Mosh

MacからLinuxサーバへ接続

boostとかをyumでインストール

% sudo yum -y install boost perl-IO-Pty-Easy

protocol buffer

% wget http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz
% tar -zxvf protobuf-2.4.1.tar.gz
% cd protobuf-2.4.1
% ./configure LDFLAGS=-Wl,-rpath,/usr/lib --prefix=/usr   
% make
% sudo paco -D make install

mosh本体

% wget https://github.com/downloads/keithw/mosh/mosh-1.1.3.tar.gz
% tar zxvf mosh-1.1.3.tar.gz
% cd mosh-1.1.3
(% export PKG_CONFIG_PATH=/usr/lib/pkgconfig)
% ./autogen.sh   
% ./configure --prefix=/usr   
% make
% sudo paco -D make install
% mosh --help
Usage: /usr/bin/mosh [options] [--] [user@]host [command...]
        --client=PATH        mosh client on local machine
                                (default: "mosh-client")
        --server=PATH        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

-p NUM  --port=NUM           server-side UDP port

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

Please report bugs to mosh-devel@mit.edu.
Mosh home page: http://mosh.mit.edu

Macにも入れる

brew update
brew install protobuf
brew install boost
brew install pkg-config

git clone https://github.com/keithw/mosh.git
cd mosh
./autogen.sh
./configure
make
make install

設定追加@サーバ側

% cd /usr/bin
% sudo mv mosh-server mosh-server.REAL
% sudo vi mosh-server
 #!/bin/sh
 LD_LIBRARY_PATH=/usr/local/lib:/usr/lib exec /usr/bin/mosh-server.REAL "$@"
% sudo chmod +x mosh-server

接続確認@mac

% mosh vmuser@vmcentos62
vmuser@vmcentos62's password: 

/home/vmuser
vmuser@vmcentos62(377) %  ★OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment