When connecting to my development server via ssh
, I can forward remote ports to local ports via:
ssh my-user@example.com -L 5432:localhost:5432
However I'd rather use mosh
because my connection tends to drop. I tried extending my usual mosh
command (that works) with the --ssh
parameter:
mosh --ssh "ssh -L 5432:localhost:5432" my-user@example.com
Which gets me connected without error - but doesn't do anything for my ports.
Is there a way to make port forwarding work when connecting via mosh
?