Skip to content

Instantly share code, notes, and snippets.

@AlexMooney
Forked from lazywei/install_mosh_locally.sh
Created August 3, 2017 20:26
Show Gist options
  • Save AlexMooney/28d077e5861ade6b7b094e9a24eb1cac to your computer and use it in GitHub Desktop.
Save AlexMooney/28d077e5861ade6b7b094e9a24eb1cac to your computer and use it in GitHub Desktop.
Install mosh server without root permission
# This is an upgrade of the script made by [email protected] that does do
# some error checking as it works.
# TODO: version number variables, make shell script to download this and build it on remote host,
# possibly use the protobuf files that seem to ship with mosh?
.PHONY: all clean
.PRECIOUS: %.tar.gz
.SECONDARY: mosh-1.3.2.tar.gz protobuf-2.6.1.tar.gz protoc
all: ${HOME}/bin/mosh
clean:
echo 'rm stuff'
${HOME}/bin/mosh: ${HOME}/mosh/local/bin/mosh
ln -f $< $@
${HOME}/mosh/local/bin/mosh: ${HOME}/mosh/build/mosh-1.3.2/Makefile
cd $(<D) && \
export PROTOC=${HOME}/mosh/local/bin/protoc && \
export protobuf_CFLAGS=${HOME}/mosh/local/include && \
export protobuf_LIBS=${HOME}/mosh/local/lib/libprotobuf.a && \
make VERSION && \
cd scripts && \
make install
${HOME}/mosh/build/mosh-1.3.2/Makefile: ${HOME}/mosh/downloads/mosh-1.3.2.tar.gz ${HOME}/mosh/local/bin/protoc
tar axf $< -C ${HOME}/mosh/build/
cd $(@D) && \
export PROTOC=${HOME}/mosh/local/bin/protoc && \
export protobuf_CFLAGS=${HOME}/mosh/local/include && \
export protobuf_LIBS=${HOME}/mosh/local/lib/libprotobuf.a && \
./configure --prefix=${HOME}/mosh/local
${HOME}/mosh/local/bin/protoc: ${HOME}/mosh/build/protobuf-2.6.1/Makefile
cd ${HOME}/mosh/build/protobuf-2.6.1 && make install
${HOME}/mosh/build/protobuf-2.6.1/Makefile: ${HOME}/mosh/downloads/protobuf-2.6.1.tar.gz
mkdir -p ${HOME}/mosh/build/
mkdir -p ${HOME}/mosh/local/
tar axf $< -C ${HOME}/mosh/build/
cd $(@D) && ./configure --prefix=${HOME}/mosh/local --disable-shared
${HOME}/mosh/downloads/mosh-1.3.2.tar.gz:
mkdir -p $(@D)
wget -O $@ https://mosh.mit.edu/mosh-1.3.2.tar.gz
${HOME}/mosh/downloads/protobuf-2.6.1.tar.gz:
mkdir -p $(@D)
wget -O $@ https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
@vonHartz
Copy link

vonHartz commented Feb 11, 2019

Thank you for this nice makefile. However, although the installation seems to work, I cannot get to actually use it. The server that I installed mosh on using this makefile does know the command 'mosh' afterwards, but neither 'mosh-server', nor 'mosh-client'.
So running 'mosh --server=/home//bin/mosh-server usr@server' fails, printing

Option s is ambiguous (server, ssh, ssh-pty)

, the mosh help and

Please report bugs to [email protected].
Mosh home page: https://mosh.org
Connection to server closed.
/usr/bin/mosh: Did not find mosh server startup message.

Using the same command but with '[...]/bin/mosh-server' only gives the latter, since the server doesn't know the command mosh-server.

Can you tell me, what I'm doing wrong?

Thank you and have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment