I've been using ssh for the longest time but now I want to try mosh but the documentation isn't the strongest.
How would I write this ssh command using the mosh command in terminal??
ssh [email protected] -p 211
I've been using ssh for the longest time but now I want to try mosh but the documentation isn't the strongest.
How would I write this ssh command using the mosh command in terminal??
ssh [email protected] -p 211
Copyright © 2021 Jogjafile Inc.
Here's the straight-forward answer from the mosh documentation
For this to work, you still need to get mosh set up including having mosh on the target host and listening on a port (by default in the 60000 to 61000 range) that is cleared for a UDP connection in the target host firewall settings.
See the "How it works" section of the README.md on github https://github.com/mobile-shell/mosh
What does that mean that the -p option has no effect on the port used by SSH? That refers to the mosh option, not the SSH option. So in other words, what you want and what I gave you above basically says: "Use port 211 to establish a connection via SSH and then, once it's all set up, use a default port for mosh in the 60000-61000 range" (assuming you have a default setup).
If, on the other hand, you were to us the mosh -p option like so
This is absolutely not going to work, because that would be telling mosh to try to connect over the port reserved for SSH, which will fail, and furthermore, it will default to trying to establish the connection via the standard SSH port 22, which will also fail. In other words, the above says: "Use SSH on port 22 to connect to the mosh server listening on port 211." Since all those things are false in your case, it doesn't work.
So in addition to specifying your particular SSH port, you need to also make sure that you have mosh running on the target host and listening either on the default ports or on another port you specify. You also have to make sure your firewall rules are set up to allow that connection.