I want to use SSH multiplexed connections and also forward my SSH agent.
When the SSH persistent socket is created by scp or sftp, the agent is not forwarded (see https://unix.stackexchange.com/a/327100/295426). If I then use ssh over the same socket then the agent is not available.
If ssh creates the persistent socket then the agent IS available.
Is there a way to have "ControlMaster no" for sftp/scp but auto for ssh?
In my ~/.ssh/config I have
Host *
ControlMaster auto
ControlPath ~/.ssh/master_%r@%h:%p
ControlPersist 180
ForwardAgent yes
This seems to be a known issue since 2016 with no official solution: https://bugzilla.mindrot.org/show_bug.cgi?id=2621