Arif’s Scratch Pad

Wget Piped to SSH

There are many times in a datacenter, where we can log into the machines remotely, but we are unable to get external access directly from the machine itself.

I have wanted to use wget to download files, but fortuntely, I found a new way to do it

So, I would like to download, onto the remote server

  • First I log on to my ssh server
  • Then I run the following command
wget -O - "" | ssh "cat >> /root/ganglia-3.6.0.tar.gz"

You should now have a file named ganglia-3.6.0.tar.gz in /root on the host