2017-05-24 07:33:32 +01:00
|
|
|
# mosh
|
|
|
|
|
|
|
|
> Mobile Shell (`mosh`) is a robust and responsive replacement for SSH.
|
|
|
|
> `mosh` persists connections to remote servers while roaming between networks.
|
2019-06-04 10:25:17 +01:00
|
|
|
> More information: <https://mosh.org>.
|
2017-05-24 07:33:32 +01:00
|
|
|
|
|
|
|
- Connect to a remote server:
|
|
|
|
|
|
|
|
`mosh {{username}}@{{remote_host}}`
|
|
|
|
|
|
|
|
- Connect to a remote server with a specific identity (private key):
|
|
|
|
|
2020-10-28 17:19:43 +00:00
|
|
|
`mosh --ssh="ssh -i {{path/to/key_file}}" {{username}}@{{remote_host}}`
|
2017-05-24 07:33:32 +01:00
|
|
|
|
|
|
|
- Connect to a remote server using a specific port:
|
|
|
|
|
|
|
|
`mosh --ssh="ssh -p {{2222}}" {{username}}@{{remote_host}}`
|
|
|
|
|
|
|
|
- Run a command on a remote server:
|
|
|
|
|
|
|
|
`mosh {{remote_host}} -- {{command -with -flags}}`
|
|
|
|
|
2023-11-12 03:08:58 +00:00
|
|
|
- Select Mosh UDP port (useful when `remote_host` is behind a NAT):
|
2017-05-24 07:33:32 +01:00
|
|
|
|
|
|
|
`mosh -p {{124}} {{username}}@{{remote_host}}`
|
|
|
|
|
|
|
|
- Usage when `mosh-server` binary is outside standard path:
|
|
|
|
|
2020-10-28 17:19:43 +00:00
|
|
|
`mosh --server={{path/to/bin/}}mosh-server {{remote_host}}`
|