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 fortunately, I found a new way to do it

So, I would like to download http://heanet.dl.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz, onto the remote server

  • First I log on to my ssh server
ssh ssh.arif-ali.co.uk
  • Then I run the following command
wget -O - "http://heanet.dl.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz" | ssh remote.arif-ali.co.uk "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 remote.arif-ali.co.uk

Leave a Reply

Your email address will not be published.