Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install mosh server without root permission
#!/bin/sh
# this script does absolutely ZERO error checking. however, it worked
# for me on a RHEL 6.3 machine on 2012-08-08. clearly, the version numbers
# and/or URLs should be made variables. cheers, zmil...@cs.wisc.edu
mkdir mosh
cd mosh
ROOT=`pwd`
echo "==================================="
echo "about to set up everything in $ROOT"
echo "==================================="
mkdir build
mkdir install
cd build
curl -O https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
curl -O https://mosh.mit.edu/mosh-1.2.4.tar.gz
tar zxvf protobuf-2.6.1.tar.gz
tar zxvf mosh-1.2.4.tar.gz
echo "================="
echo "building protobuf"
echo "================="
cd $ROOT/build/protobuf-2.6.1
./configure --prefix=$HOME/local --disable-shared
make install
echo "============="
echo "building mosh"
echo "============="
cd $ROOT/build/mosh-1.2.4
export PROTOC=$HOME/local/bin/protoc
export protobuf_CFLAGS=-I$HOME/local/include
export protobuf_LIBS=$HOME/local/lib/libprotobuf.a
./configure --prefix=$HOME/local
make install
echo "==="
echo "if all was successful, binaries are now in $ROOT/install/mosh/bin"
echo "==="
@pdewilde

This comment has been minimized.

Copy link

@pdewilde pdewilde commented Oct 3, 2017

Note: protobuf link is out of date. Go to their site, the cpp version works well

@madebyollin

This comment has been minimized.

Copy link

@madebyollin madebyollin commented Dec 29, 2017

Thanks so much for posting this! Very helpful for students without root access.

Sucessfully got locally-installed mosh working on a CentOS 7 server using ./configure --prefix=$HOME/local --disable-shared "CFLAGS=-fPIC" "CXXFLAGS=-fPIC" on line 32 to fix a relocation R_X86_64_32S against '.rodata' can not be used when making a shared object error from protobuf (I used protobuf-cpp-3.5.1 per Parker's recommendation, but the same error occurred with the 2.6.1 version in the post).

As a note, line 49 was incorrect for me–the mosh binaries were in ~/local/bin with the protobuf binary. Also, need to add export PATH=~/local/bin:$PATH to your .bashrc to get things working.

@lqxyz

This comment has been minimized.

Copy link

@lqxyz lqxyz commented Feb 10, 2018

Thank you so much! It finally works for my Linux platform after adding "CFLAGS=-fPIC" "CXXFLAGS=-fPIC" to the configure line.

@StealthBadger747

This comment has been minimized.

Copy link

@StealthBadger747 StealthBadger747 commented Sep 6, 2019

How do I keep the mosh-server running?

@faderani

This comment has been minimized.

Copy link

@faderani faderani commented Jan 7, 2021

curl no more works for getting releases from github. use with -L or wget instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.