Skip to content

Instantly share code, notes, and snippets.

@tancnle
Last active December 5, 2019 03:01
Show Gist options
  • Star 22 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save tancnle/6590743 to your computer and use it in GitHub Desktop.
Save tancnle/6590743 to your computer and use it in GitHub Desktop.
Setup mosh on Centos 6.x
#!/bin/sh
# Update latest epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -Uvh epel-release-6-8.noarch.rpm
# Download and build mosh
sudo yum -y install rpm-build rpmdevtools protobuf-compiler protobuf-devel libutempter-devel zlib-devel ncurses-devel openssh-clients perl-IO-Tty openssl-devel gcc gcc-c++
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
wget http://mosh.mit.edu/mosh-1.2.4.tar.gz
cd ~/rpmbuild/SPECS
rm mosh.spec*
wget https://raw.github.com/keithw/mosh/master/fedora/mosh.spec
rpmbuild -bb mosh.spec
ARCH=`uname -m`
sudo rpm -Uvh ~/rpmbuild/RPMS/${ARCH}/mosh-1.2.4-1.el6.${ARCH}.rpm
# Set iptables rule
sudo iptables -A INPUT -p udp -m multiport --dports 60000:61000 -j ACCEPT
@danielfl
Copy link

Thank you for this script.

@Skyfold
Copy link

Skyfold commented Jul 18, 2016

replace wget http://mosh.mit.edu/mosh-1.2.4.tar.gz with wget http://mosh.mit.edu/mosh-1.2.5.tar.gz on line 11

@yfli
Copy link

yfli commented Jul 19, 2016

line 11 and line 14, the certificate of the two sites are inconsistent with the url. Need add --no-check-certificate to work around. Though this might not be safe.

@VictorNouvellet
Copy link

Mosh 1.3.0 has been released. You can replace http://mosh.mit.edu/mosh-1.2.4.tar.gz by https://mosh.org/mosh-1.3.0.tar.gz on line 11.

@goldpumpkin
Copy link

Hello! I'm in trouble.The problem is :
No package protobuf-compiler available.
No package protobuf-devel available.
Plz help me, thx!

@kjian
Copy link

kjian commented Nov 26, 2017

@goldpumpkin
you can use sudo yum install protobuf protobuf-devel to install

@ryanerwin
Copy link

Super useful script!
Thanks for saving me a few hours of figuring this out! 🥇

@geoyws
Copy link

geoyws commented Mar 26, 2018

To install mosh, you can also do sudo yum install epel-release && sudo yum install mosh. It worked for me!

@julienisapunk
Copy link

julienisapunk commented Jun 7, 2019

Hi all,

Please find updated version of the script which includes required dependencies:

#!/bin/sh

# Update latest epel
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
# Install forenscis tools repository for protobuf-compiler and protobuf-devel
wget https://forensics.cert.org/cert-forensics-tools-release-el6.rpm
rpm -Uvh cert-forensics-tools-release-el6.rpm
# Install openfusion repository for perl-IO-Socket-IP
wget http://repo.openfusion.net/centos6-i386/openfusion-release-0.7-1.of.el6.noarch.rpm
rpm -Uvh openfusion-release*rpm

# Download and build mosh
yum -y install rpm-build rpmdevtools protobuf-compiler protobuf-devel perl-IO-Socket-IP libutempter-devel zlib-devel ncurses-devel openssh-clients perl-IO-Tty openssl-devel gcc gcc-c++
rpmdev-setuptree
cd ~/rpmbuild/SOURCES
wget http://mosh.mit.edu/mosh-1.2.5.tar.gz
cd ~/rpmbuild/SPECS
rm mosh.spec*
wget https://raw.github.com/keithw/mosh/master/fedora/mosh.spec
rpmbuild -bb mosh.spec
ARCH=`uname -m`
rpm -Uvh ~/rpmbuild/RPMS/${ARCH}/mosh-1.2.5-1.el6.${ARCH}.rpm

# Set iptables rule
iptables -A INPUT -p udp -m multiport --dports 60000:61000 -j ACCEPT

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