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)

CPAN

Setting Up CPAN to work through an internal proxy server

# cd /usr/lib
# find . -name Config.pm -print | grep CPAN
./perl5/5.8.3/CPAN/Config.pm
# vi ./perl5/5.8.3/CPAN/Config.pm
 ...
  'http_proxy' => q[internal.proxy.example.com:8080],
  'proxy_pass' => q[PlainTextPassword],
  'proxy_user' => q[USERNAME],


lftp

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

     set ftp:proxy http://USERNAME:PlainTextPassword@internal.proxy.example.com:8080
     set hftp:proxy http://USERNAME:PlainTextPassword@internal.proxy.example.com:8080
     set http:proxy http://USERNAME:PlainTextPassword@internal.proxy.example.com:8080

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

set http_proxy=http://USERNAME:PASSWORD@PROXYIP:PROXYPORT
lftp -c mirror -r --only-missing --verbose=1 http://mirrors.kernel.org/centos/5/updates/x86_64/RPMS/ /var/yum/CentOS/updates/5/en/os/x86_64/RPMS >> /var/log/getRPMupdates.log 2>&1

PatchPro

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

up2date

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. internal.proxy.example.com:8080
    • If your proxy server requires authentication, set proxyUser and proxyPassword

Wget

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

      passive_ftp = on
      http_proxy = http://proxy.example.com:8080
      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

yum

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

proxy http://USERNAME:PlainTextPassword@internal.proxy.example.com:8080