You can use SFTP's ProxyCommand option to transparently tunnel an SFTP connection over an SSH connection (a bit similar to WhiteFang34's answer, but over the SSH connection's stdin&stdout, rather than a forwarded local TCP port):
sftp -o "ProxyCommand=ssh -e none user@intermediatehost exec /usr/bin/nc %h %p 2>/dev/null" user@finalhost
(That's assuming the intermediate host has netcat installed as /usr/bin/nc -- if not, you may have to find/install some equivalent way of gatewaying stdin&stdout into a TCP session.)
What's really cool about this option is that you can add it to your ~/.ssh/config file, which makes it transparent:
Host finalhost
ProxyCommand ssh -e none user@intermediatehost exec nc %h %p 2>/dev/null
With that entry, you can use sftp, scp, and ssh to finalhost, and it'll automatically invoke the tunnel. The only nontransparent part is that it'll prompt for two passwords (intermediatehost followed by finalhost), but if you want you can eliminate that as well with SSH keypairs...
Thanks, I'll try that; and you're right it is the wrong forum; sorry. – None – 2011-03-26T22:58:34.627
After giving the user@localhost password I received the message: Received message too long 1131376238 – user74094 – 2011-03-29T23:14:55.553