Skip to content
Gabe Roche edited this page Apr 17, 2020 · 5 revisions

Mosh use cases

TTY commands like tmux and screen

without params

mosh server_alias screen

with params

mosh server_alias -- screen -dR session_name

advances usage

mosh server_alias -- sh -c 'tmux a -t pairing || tmux new -s pairing'

Works on a Synology NAS connecting to a tmux session automatically (similar to screen -R)

mosh --no-init --ssh="ssh -i public.key" --server=/remote/path/to/mosh-server user@server -- sh -c "/remote/path/to/tmux ls | grep -vq attached && /remote/path/to/tmux a || /remote/path/to/tmux new"

Non-TTY commands

It depends on volume of output.

Pipes

Probably the best way is to use regular SSH

Clone this wiki locally