Amazon Lightsail is great for getting something up quickly, but the default firewall rules preclude using mosh. I can’t imagine accessing remote availability zone instances without mosh’s sanity-maintaining buffer.
Opening the right ports
Log into your AWS portal and choose Lightsail. I include this as a discrete step, though if you need to be told this, you may need more coffee.
Click the dropdown menu for the VM and choose Manage, then choose the Networking tab.
Under the Firewall heading, click Add another. Choose Custom for the Application, UDP for the Protocol, and a Port from
61000inclusive. And hit Save.
Now you can install mosh as you would normally. I use Colin Percival’s excellent FreeBSD AMI on the server, because I’m a gentleman:
# pkg install www/mosh
And then on my macOS clients:
# brew install mosh