You do not need nc anymore. -W flag intelligently forwards traffic and interpolates correctly
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yes
Having said that, sometimes I need to remove the entry from /tmp to reconnect if my network settings have changed. > Having said that, sometimes I need to remove the entry
> from /tmp to reconnect if my network settings have changed.
You can also just send the exit command to the conn. ssh somehost -O exit
In addition, I put my controlpath in my .ssh dir. Keeps it out of the global /tmp dir. shrug controlpath ~/.ssh/cp-%r:%h:%p