There is a super easy way to use a server as “proxy” for ssh or scp connection.
Image this situation:
You are logged in MY SERVER and you need to start an scp to transfer file to REMOTE SERVER (or you need to open a SSH session). In this configuration your network firewall is blocking connection and you can start the spc or ssh session.
In case you have a MIDDLE SERVER that can be reachable from MY SERVER in ssh and that is able to open SSH session with REMOTE SERVER, then you can use it as SSH PROXY without any configuration on server.
You only need to add “-o ProxyJump=” option to the ssh or scp command, here is the syntax (user ostrich in this example):
ostrich@myserver:~# ssh -o ProxyJump=ostrich@10.0.0.2 ostrich@192.168.1.1
------
ostrich@myserver:~# scp -o ProxyJump=ostrich@10.0.0.2 filetocopy.txt ostrich@192.168.1.1:/destination/path
Of course you need to know ostrich credentials on both servers.
It’s an easy solution to create an SSH/SCP proxy without using any additional ports for SSH tunneling or requiring any complex configurations on the intermediary server.