Skip to content

Instantly share code, notes, and snippets.

@pythoninthegrass
Created May 25, 2018 23:10
Show Gist options
  • Save pythoninthegrass/f7f880f38c4d50d98c540231290ecf8f to your computer and use it in GitHub Desktop.
Save pythoninthegrass/f7f880f38c4d50d98c540231290ecf8f to your computer and use it in GitHub Desktop.
Install mosh on CentOS 7
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
yum install -y mosh
# add firewall rules
firewall-cmd --zone=public --permanent --add-port=60000-61000/udp
firewall-cmd --reload
@dreua
Copy link

dreua commented May 2, 2021

Thanks! iptables didn't work but your firewall-cmd did the trick 👍

@MagnusOxlund
Copy link

For anyone else who's new to Mosh, what you do next is launch Mosh on the client. The client will start the Mosh server on the remote machine. E.g.:
mosh -p 60000 --ssh 'ssh -F ~/.ssh/config -i ~/ssh.key johndoe@123.45.678.90' johndoe@123.45.678.90

Mosh shouldn't need the --ssh flag for subsequent connections:
mosh -p 60000 johndoe@123.45.678.90

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