2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Mosh設定 (Mac & Ubuntu@EC2)

Last updated at Posted at 2013-03-14

Moshとは

モバイル環境用ssh

  • ローミング可能
  • 断続的な接続でも平気
  • ローカルエコーで快適なレスポンス

mosh: MITからモバイル時代のSSH代替品
http://d.hatena.ne.jp/karasuyamatengu/20120411/1334092521

Mosh
http://mosh.mit.edu/

環境

  • client: MacOSX 10.8 MountainLion
  • server: Ubuntu12.04 @AmazonEC2

クライアントインストール

Homebrew

brew install mobile-shell

or インストーラダウンロード:
http://mosh.mit.edu/#getting

サーバー側インストール & ファイアウォール設定

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:keithw/mosh
sudo apt-get update
sudo apt-get install mosh
sudo ufw allow 60000:61000/udp

参考:
http://d.hatena.ne.jp/karasuyamatengu/20120411/1334092521

いざ

mosh ubuntu@myserver.com

以下のエラー

Can't locate IO/Pty.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.12.4 /opt/local/lib/perl5/vendor_perl/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.12.4 /opt/local/lib/perl5/5.12.4/darwin-thread-multi-2level /opt/local/lib/perl5/5.12.4 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl/5.12.3 /opt/local/lib/perl5/vendor_perl .) at /usr/local/bin/mosh line 38.

  • 使用するperlをMacPortsのものから内蔵のものへ変更

sudo chmod 755 /usr/local/Cellar/mobile-shell/1.2.3/bin/mosh

sudo vim /usr/local/Cellar/mobile-shell/1.2.3/bin/mosh

1行目 perl -> /usr/bin/perl

参考:
http://www.justskins.com/forums/cant-locate-io-tty-31220.html

  • EC2で利用する場合、AWSもファイアウォールの設定変更が必要

AWS Management Console: Amazon EC2: EC2 Security Groups:
quicklaunch-1を選択
Inbound タブ
Custom UDP Rule メニュー選択
Port range: 60000-61000
Add Rule クリック
Apply Rule Changes クリック

引用元:
http://d.hatena.ne.jp/karasuyamatengu/20120416/1334537979

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?