I wonder if there is a way for me to SCP the file from remote2 host directly from my local machine by going through a remote1 host.
The networks only allow connectio
This will do the trick:
scp -o 'Host remote2' -o 'ProxyCommand ssh user@remote1 nc %h %p' \
user@remote2:path/to/file .
To SCP the file from the host remote2 directly, add the two options (Host and ProxyCommand) to your ~/.ssh/config file (see also this answer on superuser). Then you can run:
scp user@remote2:path/to/file .
from your local machine without having to think about remote1.