Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Investigate what can be done with/by/using/for mosh #129

Open
moul opened this issue Mar 14, 2016 · 1 comment
Open

Investigate what can be done with/by/using/for mosh #129

moul opened this issue Mar 14, 2016 · 1 comment

Comments

@moul
Copy link
Owner

moul commented Mar 14, 2016

Thanks to @rothgar' comment, I'm opening this issue to track ideas and experiements around mosh.

Mosh is an amazing tool and adding the power of mosh in assh would be awesome.

I did some tests, but I wasn't able to find a cool way of integrating mosh with assh.


Technical note:

assh is a ProxyCommand, so basically it acts as a pipe between the ssh binary and the (remote) ssh server daemon (99% of the time, it is just a smart netcat).

mosh uses ssh to connect to the remote host to initiate a session with the mosh-server that will allow mosh-client to communicate with the mosh-server using UDP.

For now, I wasn't able to find a way to use mosh from withing assh as mosh was requiring ssh itself for the first authentication (sorry for the complicated phrase 😄).


Edit 1:: here is a proof-of-concept that works :)

$ mosh myserver nc localhost 22
SSH-2.0-OpenSSH_6.9p1 Ubuntu-2ubuntu0.1

I'm successfuly opening a valid ProxyCommand over a mosh session

@kamushadenes
Copy link

I use assh, which adds ProxyCommand to every connection, and I got it fully working with the following steps:

  • Create /usr/local/bin/mosh_fallback
#!/usr/bin/env bash
mosh --experimental-remote-ip=remote "$@"

status=$?

if [ $status -eq 5 ] || [ $status -eq 127 ] || [ $status -eq 10 ]; then
        ssh "$@"
fi
  • Just alias ssh with alias ssh "/usr/local/bin/mosh_fallback"

After that, it worked flawlessly on all my use cases, automatically falling back to ssh when mosh isn't installed on the remote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants