Tunnel YUM traffic through an SSH proxy connection

My work environment has heavily restricted access to the outside from any of our machines.  I am often spinning up new Linux machines for testing purposes and getting temporary firewall access to a specific IP is a process I do not enjoy.  As a work around, I have tunneled my YUM updates and Repos through machines that do have Repo access.

From the  machine with restricted access edit your /etc/yum.conf file adding the following line.  xxxx = the unused high port of your choice.

proxy=socks5h://localhost:xxxx

From a separate terminal type the following at the prompt.

ssh -ND xxxx username@server-with-access

This will leave you with what appears to be a hung session with an unresponsive prompt.  a simple Ctrl-c will kill the tunnel.  As long as the session is live, you can run your yum update from a separate session.

jhudgins has written 31 articles

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>