I want to copy a file from an ssh session to my local host. The problem is the ssh session isn't accessible from my local host, I need to first connect to an intermediate ssh (ssh1) session, then access to the ssh session in question (ssh2).
So far, I tried to use scp in this way :
scp username@ssh1:username@ssh2:file .
This connects to ssh1, but instead of connecting to ssh2 next, it searches for the file username@ssh2:file. Of course, this works :
1. ssh username@ssh1 2. scp username@ssh2:file . 3. exit 4. scp username@ssh1:file .
but this is time consuming, especially with entering passwords. Is there a better method?