Mosh: the mobile shell
mosh.mit.edu
mosh.mit.edu
Um, wow! https://mosh.mit.edu/elevator.txt
If you are stuck in a elevator, wait for professional help to take you out.
The other piece of lift related advice (that I really enjoy saying in more crowded, rickety lifts): I once read if in a lift that is falling you should attempt to lie flat on the bottom of the lift to limit the impact - preferably on top of another human. Some hacker news physicist will prove me apocryphal here I'm sure...
I've often seen (and used) lifts with notices up like:
Warning: does not level. Wheelchair users use other lift.The man with the stroller steps in and the elevator cuts him in half. There's a trail of blood on the wall where the man use to be. It turns out the maintenance guy forgot to put out barriers saying the elevator was under repair. He was moving it from above and didn't realize people were getting in.
Sometimes that doesn't work.
https://www.washingtonpost.com/news/morning-mix/wp/2016/03/0...
I was the flatmate. We never got a message through. I was busy on my own side courting a fine lady, and did not expect any sort of communication. I learned of the story only the next day, when I went back to work.
The building in question is operated by the city council, which did great for low rent. I think many people, me included, would have thought of calling the council first, before the fire brigade, as the city keeps technicians round the clock (supposedly) to deal with such problems.
I'm rather pleased by the elegant use of this software for such a situation.
EMERGENCY trapped in our lift
PAN-PAN trapped in our lift
911 trapped in our lift SOS stuk in our lift SOSstukinourlift
As I'm from Yorkshire SOSstckint'lift* http://www.legislation.gov.uk/uksi/1997/831/schedule/1/parag...
In accordance with the 1995 EU Directive:
* http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:...
But it is not retroactive:
* http://www.legislation.gov.uk/uksi/1997/831/regulation/5/mad...
However, there were of course earlier regulations.
* http://www.legislation.gov.uk/uksi/1991/2748/schedule/1/made
I currently use it and it's very nice. It makes me long for a better handheld though (my 4" Moto G screen is difficult to type on, even with Hacker's Keyboard).
I can have tmux sessions running on servers with say, an irc client running, mosh in, chat away for a bit, turn it off, the irc client continues running. Perfect. Same for e-mail using mutt, notes that are backed up on the server automatically using vim, etc etc. Really nice workflow.
Give me a handheld device with ssh/mosh support and I'm happy. :)
[0] https://termux.com https://play.google.com/store/apps/details?id=com.termux
Curious how the two compare.
Personally I like JuiceSSH because it has a nice simple UI for setting up and saving SSH connections. I like the extra buttons for things like ctrl/home/etc.
I'd definitely want something like Termux if I was using Android on a device with a keyboard, but for the sort of things I use a terminal/SSH for on my phone, I prefer something like JuiceSSH. Shame it's not open source though.
On topic, JuiceSSH also supports Mosh out of the box.
Sorry that I couldn't be of more help!
it would be great if they could support suspending a mosh connection so that you can have a resumable connection without having to have the radio on all the time.
It's also available from F-Droid, though i recently became aware, that somehow I only had the ARM version and not AArch64, so keep that in mind. And it also works flawlessly on N.
I do not know if you can SSH into your device if connected through bluetooth.
There was a point where I used mosh whether I was roaming or sitting at my desk, but eventually the friction of mosh made it only worthwhile to use in roaming situations. By "friction" I mean the small annoyances of (1) installing mosh on every new server, and (2) requiring the use of screen to get scrollback buffers. I frequently use screen in my workflows outside of mosh, so I would often end up in weird states where I moshed into a server and auto-attached to my dedicated "moshscreen," but then had to detach from it within the session to move to another screen that I wanted to use.
Because of those annoyances, I now just use simple SSH when sitting at my desk, and put any long-running commands into a remote screen. But mosh is still extremely useful in two narrow cases: train rides (moving between cell towers) and traveling in developing countries (high packet loss).
It's not that Mosh does anything wrong, but SSH has more features, and is supported by basically everything ever. Consequently, I stick with old-school SSH.
>lost sessions cannot always be resumed, not even root can force that. >you can't scroll the terminal unless you use screen inside mosh >can't use mosh from the university network because UDP ports are filtered >can't autocomplete hosts in the config (ssh can do that)
but i still use it and would miss it very much, the whole experience is much smoother using mosh and bad connections are more bearable with it
If you mean writing "ssh <tab>" and having it auto-complete, that's a feature of the shell (usually with some "plugin" to add support for that particular command). They added support for Bash in 2012 [1], what OS and shell are you using?
On my laptop I have a mosh session open to my remote shell basically all the time. In situations with spotty net access, it's actually a pretty reliable "canary" that indicates whether I have any access at all.
alias tmosh='() {mosh $* -- sh -c "tmux a || tmux"}'
so I can mosh into any of my ssh aliases and resume my tmux session seamlesslyI'm curious. Does any of your servers have only IPv6 address? That is, no IPv4-connectivity.
Several friends of mine are in a similar situation, so at least in my bubble, getting easy access to computers running at home is a major use-case for IPv6 :).
My one beef with it is that it effectively defeats my terminal emulator's scroll bar. Need to scroll back the output? Nope. You have to use less or more profusely.
mosh pello -- screen -drhttps://www.bountysource.com/issues/4471419-ssh-port-forward...
Same low latency as on desktop over WiFi, perfectly fine, light code editing in Vim is butter smooth. And if connection breaks I just get back to my tmux session. So, can anybody tell what I miss?
With Blink, which is Mosh for iOS (I'm the developer @BlinkShell https://twitter.com/BlinkShell), you also get full keyboard support, with Caps as Ctrl, Alt as Meta, or any other combo you want to have. And a great terminal with full configuration of color themes, fonts, etc. beyond the standard included with the app. Everything a real terminal should have.
But screen or tmux give me persistence and re-establishing an ssh connection isn't very time consuming. A terminal multiplexer has a lot of advantages that mosh does not provide.
mosh adds another layer of terminal emulation and while the extra latency might not be a killer the terminal emulation can be as it is opaque to some features.
mosh is a great idea and sometimes useful when you are changing connections or opening and closing a laptop all day but most days I think I am better off without it.
Also I rarely have a remote connection open without forwarding some ports about so mosh often doesn't do what I need anyway.
Unfortunately every layer of terminal emulation tends to filter out some terminal capabilities. It is a small thing but I like to be able to yank a selection out of a remote vim and paste it locally and last I saw mosh's terminal emulation eats the necessary control codes.
from an email earlier this week:
"For new subscribers we've increased the price to $29.00/month (USD), but we've also increased the maximum number of devices for free accounts to 100.
We think this better reflects the difference between personal and business users, providing plenty of devices in our free version and charging enough for our business customers to justify adding new features and services and to support the continued development of the entire ZeroTier ecosystem."
(I'm the founder of ZeroTier)
https://github.com/mobile-shell/mosh/issues/48
My solution to this was for the box behind NAT to join a VPN, and then connect to it via its VPN address.
The low latency features really set this one apart. The smart local echo (it underlines unconfirmed predictions) make it much nicer to use over laggy mobile networks.
Mosh from a laptop is a no-go for me because there's no Windows-based, full-featured terminal emulator (saved sessions, auth agents, etc) that supports mosh.
I've tried to reattach sessions to no avail, mosh was designed this way. I have to just kill the sessions.
Looks like I'm not alone in this either: https://github.com/mobile-shell/mosh/issues/394
The connection is set up over SSH, and mosh-client generates a random AES-OCB key and sends it to mosh-server. Packets are sent over UDP, protected using authenticated encryption, and discarded if they fail integrity protection (which is fine, since packets could just be dropped and perhaps corrupted anyway because of bad network connections). Replayed packets are invalid. At that point the client's IP address no longer matters, since it's the only entity with the key. The server accepts valid packets from anywhere, and also sends packets to the IP address that most recently sent it a valid packet.
This should as much protection as an SSH connection over TCP. One thing I'd worry about is whether the server or client can be DoS'd with invalid packets. Is there anything else that seems concerning?
There are occasional requests for the ability to write out the client key and cryptographic state to disk, so you can reboot your machine, kill and restart a process on Android, etc. without losing your connection. But they've been pushing back because it breaks this straightforwardness.
"In one concrete respect, the Mosh protocol is more secure than SSH's: SSH relies on unauthenticated TCP to carry the contents of the secure stream. That means that an attacker can end an SSH connection with a single phony "RST" segment. By contrast, Mosh applies its security at a different layer (authenticating every datagram), so an attacker cannot end a Mosh session unless the attacker can continuously prevent packets from reaching the other side. A transient attacker can cause only a transient user-visible outage; once the attacker goes away, Mosh will resume the session."
"However, in typical usage, Mosh relies on SSH to exchange keys at the beginning of a session, so Mosh will inherit the weaknesses of SSH—at least insofar as they affect the brief SSH session that is used to set up a long-running Mosh session."
Also see, "Q: What is Mosh's security track record so far?" here: https://mosh.mit.edu/#faq
Now, I wrote a 3DES-telnet tool back in 1996 and it has zero security vulnerability. That's 20 years. Safe as hell! Yeah exactly. Everyone uses OpenSSH. Very few use Mosh. Invalid comparison.
Not sure I'd agree with this, since after initial session establishment, it completely replaces the functionality of OpenSSH in a way that guards against privilege escalation and authenticates every packet.
I do agree that there are some concerns with how 'battle tested' it is, but not sure I believe this about "audits" since, I mean, the entire world was using OpenSSL to build the entire internet for ages and we just found out it was one guy scraping through the bug tracker for far too long.
The model of mosh is more secure than SSH, though its' session resumption could potentially expose a hole if someone has your token and session keys, they can resume your session.
Also, mosh was developed at MIT, where there's a good Kerberos setup for most SSH-able machines. So if you really want forwarding, you can forward your Kerberos ticket with the initial SSH connection. The mosh-server command on Athena is actually a wrapper script that copies your Kerberos ticket (so it's not destroyed when the SSH session exits) and sets up a Kerberos + AFS session for the actual mosh-server to run inside:
http://web.mit.edu/mosh_project/arch/amd64_deb60/bin/mosh-se...
There's little use for key-based authentication on Athena, let alone agent forwarding, because if you don't forward Kerberos tickets, you don't have access to your network home directory.
There is the `-c` option to `ssh-add` for that reason:
-c Indicates that added identities should be subject to confirmation
before being used for authentication. Confirmation is performed
by ssh-askpass(1). Successful confirmation is signaled by a zero
exit status from ssh-askpass(1), rather than text entered into
the requester.This seems asinine. If latency is an issue I want to know it, not be fooled into thinking my input is being interpreted correctly by 'predictions'. Does this mean when I hit 'jjjjjll' in vim, I'm going to see this underlined on-screen in mosh in high-latency situations?
Having used it, I found it worked very well and i never had a problem with predictions
> Predictions are done in epochs: when the user does something that might alter the echo behavior — like hit ESC or carriage return or an up- or down-arrow — Mosh goes back into making background predictions until a prediction from the new batch can be confirmed as correct.
Not to mention, it shows you in two ways that you have connectivity issues.
1. All echoing prints underlines, so you always know if it's predictive output or not. 2. Any prolonged connectivity issue displays a blue bar at the top of the session, showing how long you've been disconnected for.
edit: And of course, you can simply turn off predictive echo if it's a feature you hate. but man oh man, is it something to love, imo.
I've been using Mosh for years on spotty connections and this feature alone is an absolute game changer. Sure, when you're trying to `jjjj` and your network hiccups, it may look weird for a moment, but no more weird than not seeing any input imo. And when you're not `jjj`ing, but instead typing in edit mode, you don't notice anything, it's flawless.
Also, Mosh shows a blue banner on top if there is prolonged connectivity issues, so it's not like it is tricking you or anything. The feature merely smooths out the UX, and it does so amazingly well.