Live data from Hacker News

Mosh

jefftk.com

51–60 of 152 posts

Re: Mosh

#51

I used it for a while - but was worried about security. Is it as hardened as ssh?

Mosh doesn't have to do the hard part.

The difficulty is key agreement and authentication, but both those happen in SSH itself. So by the time Mosh is invoked you're definitely an authorised user and you and the server share a secret, so Mosh is just moving encrypted packets.

It uses authenticated encryption, and I don't know much about the specific mode it apparently uses, OCB3, but in general there's just not that much to go wrong over and above all the work still happening in SSH.

Re: Mosh

#52
post #30
post #20

Earlier quoted context omitted.

Of course there’s also the big problem of lack of scroll back in mosh as mosh actually handles the terminal emulation. I suppose this would be especially bad on an iPad with an on-screen keyboard, as the number of lines would be severely limited. How does Blink handle this problem? (I use Prompt 2 on my 12.9’’ iPad Pro which doesn’t support mosh. I only use mosh on computers with very high latency servers.)

Yeah, Blinks doesn't handle the scrollback problem neither. I always use a bluetooth keyboard when I connect the shell so I launch tmux inside of it, so I use tmux's scrollback feature. Besides I don't much need scrollback when I use iPad anyway. I have to admit that terminal is inherently not suited for touchscreen. Here I am suggesting iPad Pro a laptop alternative for a dedicated terminal use, where you use a phys…

But if you're running tmux then the "never get disconnected or lose terminal sessions" of mosh goes from major feature to minor feature.

Re: Mosh

#53
As someone who codes on a remote server the whole day, mosh is absolutely necessary and it is fantastic

Advantages:

- you dont see any lag when you type, it is exactly as if you were on your local machine

- when network disconnect, the terminal freeze and when network is up again, the terminal becomes interactive again preserving everything in between

- connection is preserved as long as the terminal is open, so even after hibernation your session is preserved

Drawbacks:

- you can't scroll , but if you use tmux then it is possible . I've tried using Eternal terminal, as it allows to scroll but it doesn't perform well at all on laggy connections

- You can't detach and re attach mosh connections (same for ET)

- I'm not sure it is possible to preserve middle-click copy/paste (at least I've not managed to make it work)

- time to connect is a bit longer than normal ssh

Re: Mosh

#54
post #8

The article misses the other great feature of Mosh: It never get disconnected, regardless of the client's state (IP address change, or device sleep mode), and you will never loose terminal sessions. When this is not so appealing to desktop users, it is a godsend feature for laptop/mobile users. Especially, if you are an iPad user you should try Blink shell app [1] with Mosh. This combination turns the iPad your favor…

(author)

I was already using tmux for session persistence, so the local echo and handling of congested networks were the two features that made me wish I'd switched to mosh earlier.

Re: Mosh

#55
post #35
post #34

Earlier quoted context omitted.

> There are moments that tmux's persist session won't work well such as opening nested SSH sessions to another machine with nested tmux to keep the session. what difficulties are you facing there? i use tmux deeply nested without problems. one trick i use is to change the tmux command key to be something different on each nesting level.

> one trick i use is to change the tmux command key to be something different on each nesting level. This is exactly the difficulty I never want to see...

If you just want a persistent connection, you never have to press the command key or even acknowledge it exists, do you? And you didn't answer what difficulties you've personally faced.

Re: Mosh

#56
post #30

Earlier quoted context omitted.

Yeah, Blinks doesn't handle the scrollback problem neither. I always use a bluetooth keyboard when I connect the shell so I launch tmux inside of it, so I use tmux's scrollback feature. Besides I don't much need scrollback when I use iPad anyway. I have to admit that terminal is inherently not suited for touchscreen. Here I am suggesting iPad Pro a laptop alternative for a dedicated terminal use, where you use a phys…

But if you're running tmux then the "never get disconnected or lose terminal sessions" of mosh goes from major feature to minor feature.

You should anyway run mosh+tmux. Not sure about this though, ssh still disconnects and you have to reconnect and then launch tmux attach again. I agree it doesn’t seem like much, but just opening any device and continue from where you left off without any extra interaction feels great. It is kinda like auto save on iOS, you could argue that pressing the save and open button isn’t that big of a deal, but once you experience it the experience changes completely.

Re: Mosh

#57
post #33
post #30

Earlier quoted context omitted.

Yeah, Blinks doesn't handle the scrollback problem neither. I always use a bluetooth keyboard when I connect the shell so I launch tmux inside of it, so I use tmux's scrollback feature. Besides I don't much need scrollback when I use iPad anyway. I have to admit that terminal is inherently not suited for touchscreen. Here I am suggesting iPad Pro a laptop alternative for a dedicated terminal use, where you use a phys…

I sometimes use Prompt with the on-screen keyboard when I'm working out on a treadmill. It's neither pleasant nor productive, but it's okay. Btw, tmux scrollback sucks except when the terminal emulator's native scrollback is supported through control mode.

May I ask, why do you keep using Prompt? Full disclosure, I’m one of Blink Shell devs.

Re: Mosh

#58
post #53

As someone who codes on a remote server the whole day, mosh is absolutely necessary and it is fantastic Advantages: - you dont see any lag when you type, it is exactly as if you were on your local machine - when network disconnect, the terminal freeze and when network is up again, the terminal becomes interactive again preserving everything in between - connection is preserved as long as the terminal is open, so even…

Why do you code on a remote server?

Re: Mosh

#59
post #16

Earlier quoted context omitted.

There are moments that tmux's persist session won't work well such as opening nested SSH sessions to another machine with nested tmux to keep the session. Also, tmux does not handle SSH sessions, so if a SSH session disconnected (e.g. WiFi signal lost, your macBook gets sleep mode), you need to manually restart the SSH session and run tmux again, whereas Blink and ET never disconnects the SSH session. On top of that,…

Right, I see how it can be more convenient but I also see caveats so I’m not sure if I should bother. I’m not really a fan of installing much, either: often I don’t really want to do a whole install to get into a machine (some random AWS for instance) or I just can’t (not my machine, no admin privileges, paltry package manager, …)

You can always try it on one machine and see if it makes your life better or not.

Re: Mosh

#60

I started using mosh a few weeks ago when I was working over ssh more. Even for working over LAN it was attractive because I'm really sensitive to typing latency. Don't be like the author and put off trying it, it's dead easy to install and try. No setup and no commitment to keep using it. However, I quickly ran into a problem which is that it breaks a scrollback. This is the one big problem with mosh and will probab…

Terminal emulators (xterm, iterm2 etc) are emulating something like a VT220 which were called "glass terminals" to differentiate them from earlier terminals which were keyboards attached to printers. So there's still this underlying concept of an endless spool of paper, and that's what you see when you scroll back. A scroll is literally a long piece of paper. Anyway that means if you cat some long file and then hit c…

Mosh could easily load the skipped-over lines in the background. It's not incompatible with the design. It just requires a developer to put in the effort.
Post reply on HN