This is a weird situation where the same command works when inputted directly in shell but not when it's a ProxyCommand in ssh config file.So this works: $ ssh -A -R 40022:git.some.pt:22 -t -t user@bastion.net ssh -t -t -R 40022:localhost:40022 user@destination.netBut this doesn't:in ~/.ssh/configHost destination  ProxyCommand ssh -A -R 40022:git.some.pt:22 -t -t user@bastion.net ssh -t -t -R 40022:localhost:40022 user@destination.net$ ssh destinationBad packet length 218783296.Disconnecting: Packet corruptAny ideas why?
ssh bastion host proxy command
ssh
You need to allow your command line ssh to connect to an ssh server somewhere. Your existing ProxyCommand doesn't do that - it provides all the means to log in somewhere and there's nothing left for your initial ssh.This seems to work reasonably well for me, and I think I've got your chain right (obviously it's harder for me to test with the same hostnames that you use). Note that it does use nc rather than ssh on the bastion host, though:Host destination.net        User user        ProxyCommand ssh -A user@bastion.net nc %h %p        ForwardAgent yes        RemoteForward 40022 git.some.pt:22I have also been looking at running /usr/sbin/sshd -i on the end of ssh -p %p user@%h (instead of the nc %h %p), as suggested by man ssh_config, but I cannot get that to work. Maybe you'll have more luck.