Dealing With Proxy Servers

From The System Administrator Zone
Revision as of 14:51, 21 November 2012 by BobVanCleef (talk | contribs) (lftp)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Setting Up CPAN to work through an internal proxy server

# cd /usr/lib
# find . -name -print | grep CPAN
# vi ./perl5/5.8.3/CPAN/
  'http_proxy' => q[],
  'proxy_pass' => q[PlainTextPassword],
  'proxy_user' => q[USERNAME],


To get lftp to work through an internal, authenticating firewall, edit /etc/lftp.conf:

     set ftp:proxy
     set hftp:proxy
     set http:proxy

If you setup and export the "http_proxy" first, you can drop the username / password from the command line.

lftp -c mirror -r --only-missing --verbose=1 /var/yum/CentOS/updates/5/en/os/x86_64/RPMS >> /var/log/getRPMupdates.log 2>&1


For notes on using Sun's PatchPro service, see:
Patching using PatchPro Software: Proxy Related Variables


Configuring up2date for Red Hat / Fedora Linux

  • As root, run up2date-config --nox
  • Use the numbered menu to change up2date settings as follows:
    • Set enableProxy to Yes
    • Set httpProxy to the name of your proxy server with port, e.g.
    • If your proxy server requires authentication, set proxyUser and proxyPassword


To use *wget* behind an authenticating proxy server, you need to setup a ~/.wgetrc file with the following information:

      passive_ftp = on
      http_proxy =
      proxy_user = USER
      proxy_passwd = PASSWORD

Unfortunately, this means having a non-encrypted copy of the password on the system.

  • read protect the file from other users
      > chmod 600 ~/.wget
  • use a specialized account for access to the proxy server


To use *yum* behind an authenticating proxy server, you need to add one line to */etc/yum.conf*.