title: Run wget command via ssh remotely but connection timeout
body: <p>I've been struggling with this for 2 days already.</p>
  
  <p>I have 2 linux machines A and B and trying to run the following command from A remotely (as it would be done on B locally):</p>
  
  <p>sshpass -p 'somePassword' ssh userName@machineB "wget <a href="http://someUrl.com/someFile.zip" rel="nofollow">http://someUrl.com/someFile.zip</a>"</p>
  
  <p>someFile.zip should be downloaded and kept on B but I get connection timeout.
  Running this command directy on macnine B works fine. I presume there are some issues with SSH.</p>
  
  <p>This script is needed for TeamCity continous integration.</p>
  
  <p>p.s. sshpass is just an utility to run command via ssh without user interaction by specifying password.</p>
  
  <p>What the issue and how to fix it? Thank you.</p>
  
  <p><strong>UPDATE:</strong> Proxy settings should be specified in ~/.bashrc file for non-interactive sessions. The reason is that proxy setting were in /etc/profile which works only for interactive sessions. </p>