1. 7
  1.  

  2. 6
    ProxyCommand ssh -aY bastion 'nc -w 900 `echo %h | sed s/\\.bast$//` %p'
    

    Don’t do this. Instead, do

    ProxyCommand ssh -W `echo %h:%p | sed s/\\/bast:/:/` bast
    

    -W is “netcat mode” which was added back in 5.4.