Posted by Seamus on Saturday, April 14, 2012.

How to install mosh on Amazon EC2

Here’s how to install mosh on Amazon EC2 instances:

Using EPEL

Thanks to @masnick’s instructions on the mosh wiki:

  1. Enable the EPEL repository.
  2. sudo yum install protobuf-compiler protobuf-devel libutempter-devel ncurses ncurses-devel zlib-devel boost-devel
  3. Download the latest release from http://mosh.mit.edu, unzip, and ./configure, make, sudo make install.

Without EPEL

You have to install protobuf-compiler and protobuf-devel manually. Most of the rest is the same.

$ sudo yum install git-core boost-devel libutempter-devel ncurses-devel zlib-devel perl-CPAN cpp make automake gcc-c++
$ sudo cpan IO::Pty
  [say yes twice]
$ curl -O "http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz"
$ tar -xzf protobuf-2.4.1.tar.gz 
$ cd protobuf-2.4.1
~/protobuf-2.4.1$ ./configure 
~/protobuf-2.4.1$ make
~/protobuf-2.4.1$ sudo make install
~/protobuf-2.4.1$ sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
~/protobuf-2.4.1$ sudo ldconfig | grep proto
  [you should see libprotobuf, etc.]
~/protobuf-2.4.1$ cd
$ git clone https://github.com/keithw/mosh
$ cd mosh
~/mosh$ ./autogen.sh 
~/mosh$ ./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
~/mosh$ make
~/mosh$ sudo make install

Here’s something that’s easy to copy-paste:

sudo yum install git-core boost-devel libutempter-devel ncurses-devel zlib-devel perl-CPAN cpp make automake gcc-c++
sudo cpan IO::Pty
  [say yes twice]
curl -O "http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.gz"
tar -xzf protobuf-2.4.1.tar.gz 
cd protobuf-2.4.1
./configure 
make
sudo make install
sudo echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
sudo ldconfig | grep proto
  [you should see libprotobuf, etc.]
cd
git clone https://github.com/keithw/mosh
cd mosh
./autogen.sh 
./configure PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
make
sudo make install

See the full log here.

Then you need to open the EC2 port: (note UDP)

Opening ports 60000-61000

What blog is this?

Safety in Numbers is Brighter Planet's blog about climate science, Ruby, Rails, data, transparency, and, well, us.

Who's behind this?

We're Brighter Planet, the world's leading computational sustainability platform.

Who's blogging here?

  1. Patti Prairie CEO