Host remote.example.net ProxyCommand ssh root@hop perl -MIO::Socket -e "'\$|=1;\$s=IO::Socket::INET->new(shift);if(\$c=fork()){print while(read(\$s,\$_,1)>0);kill(2,\$c)}else{print{\$s}\$_ while(read(STDIN,\$_,1)>0)}'" %h:22