Do you run into errors like the following when using (1) #sshfs to mount the fs of a host that you (2) later #ssh into where your local ssh config (3) enables a ControlMaster for multiplexing and also (4) forwards something?
"""
mux_client_forward: forwarding request failed: remote port forwarding failed for listen path [...]
muxclient: master forward request failed
ControlSocket /home/[…] already exists, disabling multiplexing
"""
This happens because sshfs (rightfully) sets "ClearAllForwardings". Here are two options to avoid this:
* add "ssh_command='ssh -o ControlMaster=no'" to your sshfs call
* add "ssh_command='sshfsssh'" to your sshfs call and create a executable file "sshfsssh" somewhere in your path with code like the following, which will create the ControlMater before mounting:
"""
#! /bin/bash
for option in "$@"; do
if [[ "${option:0:1}" == "-" ]] || [[ "${option}" == "sftp" ]]; then
continue
fi
# FIXME: this seems to work, but I wonder if there is a more reliable way to retrieve the host without checking options
likely_host="${option}"
done
# briefly connect to host to initialize ControlMaster including forwarding
ssh -n "${likely_host}" :
ssh "$@"
"""