forward port
How to forward local port 8385 to remote port 8384
ssh -L 8385:localhost:8384 remote
close ControlPersist sessions
The -O
flag controls an active connection multiplexing master process.
Valid commands are:
- check: check that the master process is running
- forward: request forwardings without command execution
- cancel: cancel forwardings
- exit: request the master to exit
- stop: request the master to stop accepting further multiplexing requests
Either exit or stop should work.
ssh -O stop server
or
ssh -O exit server