login community faq
0
1

Does anyone have and installation guide for mosh, the mobile shell?

asked May 03 '12 at 04:16

ryans's gravatar image

ryans ♦♦
28411420

Any plans to install mosh on all servers by default? That would help a lot!

(Jan 29 at 21:35) mbrochh mbrochh's gravatar image

Not likely in the foreseeable future. Mosh is useful but not yet often requested, and even if available system-wide, a support ticket is still necessary to have the associated port opened in the firewall.

(Jan 29 at 22:18) ryans ♦♦ ryans's gravatar image

Introduction

Here is an installation guide for mosh 1.2.

You can run these commands individually, or you can paste them into a shell script and run it as

1
bash -e build_mosh-1.2.sh | tee build_mosh-1.2.log

Either way, you will want to run it in a screen session.

In order to use mosh, you will need to get an open-ports IP address and have a port opened. The following instructions refer to this IP address as EXTERNAL_IP and the port as EXTERNAL_PORT.

After installation on WebFaction, you must also install mosh locally (on Ubuntu, apt-get install mosh).

Once mosh is available on both your local machine and on WebFaction, you can connect from your local machine using something like this:

1
2
3
4
WF_USERNAME=my_user
EXTERNAL_IP=123.123.123.123
EXTERNAL_PORT=5555
mosh -p ${EXTERNAL_PORT} --server=/home/${WF_USERNAME}/bin/mosh-server "${WF_USERNAME}@${EXTERNAL_IP}"

It may be convenient to place this into a script on your local machine to connect with significantly less typing.

Installation Procedure

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# set up standard build environment
mkdir -p $HOME/src $HOME/tmp
export TMPDIR="$HOME/tmp"
export PATH="$HOME/bin:$PATH"
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
export CPPFLAGS="-I$HOME/include $CPPFLAGS"
export LDFLAGS="-L$HOME/lib $LDFLAGS"
export PKG_CONFIG_PATH="$HOME/lib/pkgconfig"
mkdir -p $HOME/lib/${PYTHON}
export PYTHON=python2.7
mkdir -p $HOME/lib/perl5
export PERL5LIB="$HOME/lib/perl5"
export CFLAGS="-O2 -pipe"

# fix lib64
if [ ! -L "$HOME/lib64" ]; then ln -s $HOME/lib $HOME/lib64; fi

###########################################################
# protobuf 2.4.1
# original: http://protobuf.googlecode.com/files/protobuf-2.4.1.tar.bz2
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/protobuf-2.4.1.tar.bz2'
tar -xjf protobuf-2.4.1.tar.bz2
cd protobuf-2.4.1
./configure --prefix=$HOME
make
make install

###########################################################
# IO-Tty Perl module
# original: http://search.cpan.org/CPAN/authors/id/R/RG/RGIERSIG/IO-Tty-1.02.tar.gz
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/IO-Tty-1.02.tar.gz'
tar -xzf IO-Tty-1.02.tar.gz
cd IO-Tty-1.02
perl Makefile.PL INSTALL_BASE=$HOME
make
make install

###########################################################
# mosh 1.2
# original: https://github.com/downloads/keithw/mosh/mosh-1.2.tar.gz
###########################################################
cd $HOME/src
wget 'http://mirror.ryansanden.com/mosh-1.2/mosh-1.2.tar.gz'
tar -xzf mosh-1.2.tar.gz
cd mosh-1.2
./configure --prefix=$HOME
make
make install

# make wrapper
cd $HOME/bin
mv mosh-server mosh-server.bin
cat << "EOF" > mosh-server 
#!/bin/bash

export PATH="$HOME/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"

exec $HOME/bin/mosh-server.bin $@
EOF
chmod 755 mosh-server
This answer is marked "community wiki".

answered May 03 '12 at 04:28

ryans's gravatar image

ryans ♦♦
28411420

wikified May 03 '12 at 04:28

I followed the above installation procedure (including the custom application) but had troubles connecting to my Webfaction account with mosh.

After authenticating with SSH, mosh presents me with the message: "nothing received from server on udp port".

I'd appreciate any help debugging this error. I'm on CentOS5 machine if that makes any difference.

EDIT: I'm betting it's because I don't have a dedicated IP with my account. Nevermind.

(Jan 06 at 22:09) pwenzel pwenzel's gravatar image

In order to use mosh, you will need to get an open-ports IP address and have a port opened.

I would like to clarify this for others who may be new to webfaction, since I had no idea what this was.

Create an new application with the following:
App Category = Custom
App Type = Custom App (Listening on port)

This creates a open port that the mosh server can use. It will show the port number after creation.

answered Aug 08 '12 at 13:16

therealkingk's gravatar image

therealkingk
1

Yes, this reserves a port for you on all interfaces. After creating the Custom App (listening on port), though, you'll still need to open a support ticket to have this port opened in the firewall.

(Jan 29 at 22:13) ryans ♦♦ ryans's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×1

Asked: May 03 '12 at 04:16

Seen: 504 times

Last updated: Jan 29 at 22:18

Related questions

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited