Using Mosh instead of SSH

ssh

#1

I’ve been using Resin.io for a recent project that is using a 3G USB modem to connect to the internet, and in testing I’ve noticed that SSH isn’t particularly responsive on slow connections like this. Even worse, when deployed my project will likely have a more flaky/inconsistent connection.

With that in mind, I’m curious if anyone has managed to get something like https://mosh.org/ working with Resin (if it’s even possible?), or if anyone on the Resin team has looked in to adding it as an option instead of SSH for remote access into devices. It seems like a great fit considering that Resin enables projects that are often using cellular connections.

I’d love to hear anyone’s thoughts/opinions on the matter, and if you have tips for improving/dealing with SSH over a cellular connection I’m all ears.

Alex


[Feature Request] Support mosh shell
#2

Hey Alex, we’ve had a couple people ask about Mosh, including those (such as yourself) who are using cellular. We’ve opened up an issue to explore it further and will let you know what we come up with.

Thanks for the feedback!


#3

@alisondavis17 Any updates on this?

Even without a cellular connection, the ability of mosh to gracefully handle disconnects is really handy.

I tried using it with the resin public URL, but doesn’t work.

on device

$ mosh-server new

MOSH CONNECT 60001 KuWWx7LXjE11KZpY8JO8vA

mosh-server (mosh 1.3.2) [build mosh 1.3.2]
Copyright 2012 Keith Winstein <mosh-devel@mit.edu>
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[mosh-server detached, pid = 400]

on desktop

$ mosh root@<device hash>.resindevice.io
root@<device hash>.resindevice.io: Permission denied (publickey).
/usr/bin/mosh: Did not find mosh server startup message. (Have you installed mosh on your server?)

nmap output

$ sudo nmap -sU -p 6001 d75c7b13cb5c8cdda9814eaa547e04f1.resindevice.io 
     
Starting Nmap 7.70 ( https://nmap.org ) at 2018-08-08 13:47 IST
Nmap scan report for d75c7b13cb5c8cdda9814eaa547e04f1.resindevice.io (52.72.143.113)
Host is up (0.29s latency).
Other addresses for d75c7b13cb5c8cdda9814eaa547e04f1.resindevice.io (not scanned): 34.237.177.154
rDNS record for 52.72.143.113: ec2-52-72-143-113.compute-1.amazonaws.com

PORT     STATE         SERVICE
6001/udp open|filtered X11:1

Nmap done: 1 IP address (1 host up) scanned in 16.40 seconds

#6

Hi @devxpy our team hasn’t had a chance to look into this yet, but I know there’s interest in exploring mosh, when time allows :slight_smile: I’ve pinged a couple of people on the team to see if they might be able to take a closer look during a hack Friday soon.


#7

Alright @devxpy @alexland, one of our engineers put together a rough PoC, if you’d like to have a look as a starting point (thanks @afitzek!): https://github.com/resin-io-playground/resin-mosh-poc


#8

I was hoping it could work over the resin VPN, but ngrok is fine. Thanks for the prompt reply!