This is a fantastic tool! I've always had to reference a markdown file with SSH tunnel syntax whenever I wanted to create one. I can see myself using this quite a bit in the future.
This whole thread makes me think of Alan Cooper, and how he bashes developers in The Inmates Are Running the Asylum basically as people out of touch with the rest of humanity in that we got used to rudimentary tools and our love for them and maybe the time and pain spent learning them makes us victim blame users, not that your comment is doing that, but maybe we do that unconsciously.
I was going to comment on the whole persona thing he started but it’s to early in the morning for such things
If it's easy for you to remember ssh syntax, then for you ssh is the better tool.
As far as I'm concerned, I never remember the different syntax between -L, -R, -D, etc. Always have to read a doc somewhere.
operations are easy :(c)reate, e(x)tract, (t)est
options the same: (f)ile, (v)erbose, g(z)ip compression.
the only illogical ones is bzip2 compression and xz compression with -j and -J
I think i can remember cpio syntax as well, though i haven't used that i a decade, but did use it quite often in my old sysadm job.
This seems to imply that he is not 'storing other things in life' because he's able to remember that L=local forwarding R=remote forwarding and D=socks proxy
The irony being that remembering that is almost guaranteedly easier than acquiring and installing mole on every machine where you may need to Port forward.
You can do the same thing with the ~/.ssh/config file. Add a configuration block for the host you want to connect to with the ports you want to map. I agree that an official user interface to editing the config with the most common examples would be really handy.
As for predictive character insertion, when i'm working in a shell, especially with high latency, i prefer my commands to be as i type them, not something some algorithm "guessed" i was going to type.
It doesn't guess. It sinoly has local echo, and the characters that are not-yet-ack'd are underlined. Changes your life when working with 175ms+ latency
That's not what mosh is, it doesn't predict what you're going to type. It however proactively renders the characters you type before it receives confirmation from the tty on the other end.
In other words, imagine typing ssh somebox.typo.com and waiting 1 second before the text renders and discovering the typo, then pressing backspace, waiting a while for the backspaces to render, then going through all of this again. With mosh you'll be able to instantly see what you typed and fix it. On high latency connections it makes a huge difference in quality of life.
I worked as a sysadm at at "large" (local scale) UNIX SysV installation back in the early 90s.
Everything there connected via serial ports, remote offices got multiplexed over a 9600 baud connection.
Back then we had local echo for the sometimes slow link, i.e. printing a spreadsheet converted to 3Mb PostScript, and still only 9600 baud in total.
So i know what local echo is. It has nothing to do with prediction :)
I'm still not convinced about mosh, but it sounds like it really does help a lot of people, so who am i to judge.
I guess i'm privileged since i don't usually experience latency. We have about 95% 4G coverage in this country, coupled with fiber connections.
The last time i experienced any noticeable latency was when editing files on a clients SCO OpenServer across The Atlantic Ocean over a 1200 baud connection.
I've taken to using OpenVPN to home when mobile, except for the absolute basics (I don't have it running on my phone 24/7), which deals with that fine too.
As well as that and protecting unencrypted traffic on public WiFi, I get my ad blocker & other protection and credit card payments are smoother as the payment processors think I am at home not coming from some random address so doesn't ask for extra security details as often as they otherwise would.
> So i know what local echo is. It has nothing to do with prediction :)
Not precisely, because you're sometimes predicting whether a keypress should be rendered as a letter on the screen or not (e.g. if you click 'j' in vim command mode it doesn't actually print j). mosh, at least from my experimentation, seems smart enough to do that reliably.
You are privileged! It is a daily part of life in South Africa -- around 200ms to the EU and more for anywhere else. That kind of delay becomes extremely jarring when you are working on a VPS or doing anything, really. Local VPSs are expensive and just not on par with something like DO. I believe there's a great opportunity for opening up a DO-like service in JHB with VPS @ R70/mo.
We also never have enough players for the latest FPS games that require low latency :(
Mosh support roaming and intermittent connectivity which is really super useful if you have to debug a server on a very dodgy 3g connection in a moving train.
tmux solves the session resumption at a lower level. You can have a connection from home, jump on a train, open your laptop and keep typing and do the same when you get into the office. You don't need to re-auth each time (or deal with delayed disconnects).
It works well WITH tmux, not instead of tmux.
Which means your solution would be something like:
there's multiple ways to make tunnels in ssh. -L is one of them (local forwarding). basically, local, remote and dynamic forwarding are possible. there's some interesting uses for the latter 2 as well so if you only know -L it might be nice to check out the other methods and how you can use those. You can for example, forward a remote localhost port of a server to your own localhost, and then have a fully encrypted channel to some internal or locally bound service. for example if some server hosts a site on it's loopback or some service is listening there which you want to interact with, then you can do it directly from your own machine instead of through an active ssh session. (for example with websites this is useful, because then you can have a graphical browser instead of links via ssh x11 forwarding or w/e)
I don't think you missed anything.. I'm pretty sure I've seen a few similar apps like this on HN, but I don't really understand the draw of them over just using ssh's built in options.. You can even configure tunnels in ~/.ssh/config for "aliases".
I think it's worth drawing attention to it. It's a very useful feature; just don't tell the network administrators.
NB including
*:
does mean anyone on your local network (assuming a firewall at the gateway) can use your computer to proxy to work. That's great if you're on a private LAN and want to look at a work site on your phone, but not great at a coffee shop.
And when that proxy is worth it's salt, it shall detect attempts to tunnel plain ssh over said ports.
This is 2018, anyone who can bypass their corporate proxy with that example, should find employment elsewhere or atleast prepare to do so since your company's internals will surface on twitter any time now.
This command actually fails if /usr/local/bin doesn't exist. He could simplify it by releasing the binary alone and running `curl -L --create-dirs -o /usr/local/bin/mole https://...`, but my guess is uncompressed it's huge. (edit: possible that the GitHub server would support `curl --compressed ...`, allowing the HTTP connection to compress it in transit)
I have a number of connections I need to maintain - e.g. have reopened automatically - and I've been using Secure Pipes on Mac for a couple months now, very happy with it.
60 comments
[ 1.8 ms ] story [ 194 ms ] threadI find it easy to remember, it's just one flag (-L) with local_port:remote_ip:remote_port
to forward local port 3306 to mysqlhost:3306:
The strength of using ssh is that you can forward multiple ports with the same connection. i.e.In the same topic, do you remember the syntax of tar? I don't. https://www.xkcd.com/1168/
copy files from a to b:
operations are easy :(c)reate, e(x)tract, (t)est options the same: (f)ile, (v)erbose, g(z)ip compression. the only illogical ones is bzip2 compression and xz compression with -j and -JI think i can remember cpio syntax as well, though i haven't used that i a decade, but did use it quite often in my old sysadm job.
copy files from a to b by piping :
or simply for all you kids:My brain chooses to store other things in life.
It's the same with mosh. Normally i use tmux on the destination host, and i simply cannot see any reason to use mosh over ssh/tmux.
How about automatic session resumption and predictive character insertion to improve typing when under latency?
In other words, imagine typing ssh somebox.typo.com and waiting 1 second before the text renders and discovering the typo, then pressing backspace, waiting a while for the backspaces to render, then going through all of this again. With mosh you'll be able to instantly see what you typed and fix it. On high latency connections it makes a huge difference in quality of life.
Basically for those with experience of text terminals genrally: local echo.
Everything there connected via serial ports, remote offices got multiplexed over a 9600 baud connection. Back then we had local echo for the sometimes slow link, i.e. printing a spreadsheet converted to 3Mb PostScript, and still only 9600 baud in total.
So i know what local echo is. It has nothing to do with prediction :)
I'm still not convinced about mosh, but it sounds like it really does help a lot of people, so who am i to judge. I guess i'm privileged since i don't usually experience latency. We have about 95% 4G coverage in this country, coupled with fiber connections.
The last time i experienced any noticeable latency was when editing files on a clients SCO OpenServer across The Atlantic Ocean over a 1200 baud connection.
As well as that and protecting unencrypted traffic on public WiFi, I get my ad blocker & other protection and credit card payments are smoother as the payment processors think I am at home not coming from some random address so doesn't ask for extra security details as often as they otherwise would.
Not precisely, because you're sometimes predicting whether a keypress should be rendered as a letter on the screen or not (e.g. if you click 'j' in vim command mode it doesn't actually print j). mosh, at least from my experimentation, seems smart enough to do that reliably.
We also never have enough players for the latest FPS games that require low latency :(
It works well WITH tmux, not instead of tmux.
Which means your solution would be something like:
But that lacks the other benefits, especially having to wait for the session to timeout.. Take a look at: https://en.wikipedia.org/wiki/Mosh_(software)#Performancehttps://www.everythingcli.org/ssh-tunnelling-for-fun-and-pro...
Someone else opened an issue requesting that: https://github.com/davrodpin/mole/issues/22
It also has aliases to store configuration that user usually use, but that is comparable to the ssh config file.
ETA: largely redundant comment now the parent now also mentions this option. :)
NB including
does mean anyone on your local network (assuming a firewall at the gateway) can use your computer to proxy to work. That's great if you're on a private LAN and want to look at a work site on your phone, but not great at a coffee shop.Assuming that said corporation isn’t blocking random ssh connections with their fancy NGFW. ;)
This is 2018, anyone who can bypass their corporate proxy with that example, should find employment elsewhere or atleast prepare to do so since your company's internals will surface on twitter any time now.
$ mole -v -remote :80 -server example1
The missing "-local" flag will make mole to listen on a random local port.
ssh -L 21234:localhost:1234 bob@server.com
I will confess that I googled it numerous times until one day I realized how silly and obvious it was and now it's burned into my brain...
autossh detects and restarts broken tunnels and uses aliases and tidy config files: https://www.everythingcli.org/ssh-tunnelling-for-fun-and-pro...
https://localtunnel.github.io/www/
ZeroTier solves all your networking needs and much more, the thing is pure power.
curl -L https://... | tar xz -C /usr/local/bin
curl -L https://github.com/davrodpin/mole/releases/download/v0.2.0/m... | tar xz -C /usr/local/bin
And there are plans to implement a script to improve this process: https://github.com/davrodpin/mole/issues/19
https://www.opoet.com/pyro/