I have a server in USA (Linux box B), and my home PC (Linux box A),and I need download a file from website C,The issue is, it is very slow to download a file direct from A,so I need download the file when I log in B, and sftp get the file from A.Is there any way that I can download file and use B as proxy directly through only one line command?
How to download a file through an SSH server?
ssh;wget
(Strange situation, doesn't something like the triangle inequality hold for internet routing?)Anyway, try the following, on A, ssh into B with a -D argument,ssh -D 1080 address-of-Bwhich acts as a SOCKS5 proxy on 127.0.0.1:1080, which can be used by anything supporting SOCKS5 proxied connections.  Apparently, wget can do this, by using the environment variableexport SOCKS_SERVER=127.0.0.1:1080wget http://server-C/whateverNote that sometimes curl is more handy (i.e. I'm not sure if wget can do hostname lookups via SOCKS5; but this is not one of your concerns I suppose); also Firefox is able to work completely through such a SOCKS5 proxy.Edit I've just now noticed that you're looking for a one-line solution.  Well, how about ssh address-of-B 'wget -O - http://server-C/whatever' >> whateveri.e. redirection the wget-fetched output to stdout, and redirecting the local output (from ssh running wget remotely) to a file.This seems to work, the wget output is just a little confusing (saved to -), you can get rid of it by adding -q to the wget call.