Set Proxy Authentication on Linux CentOS Redhat (Using YUM with a Proxy Server)
Running a Linux box and using “yum” command behind a proxy that requires authentication is really painful, you will need to make some configuration to get full internet access. Let me explain you how to get rid of it. First, Open your terminal and add these lines (given below) to the “.bashrc” file. It will set proxy for wget, http, https and ftp access.
Configuring Proxy Server Access
To enable all yum operations to use a proxy server, specify the proxy server details in /etc/yum.conf. The proxy setting must specify the proxy server as a complete URL, including the TCP port number. If your proxy server requires a username and password, specify these by adding proxy_username and proxy_password settings.
# vi /etc/yum.conf# The proxy server - proxy server:port numberproxy=http://:@:# The account details for yum connectionsproxy_username=yum-userproxy_password=qwertyConfiguring Proxy Server Access for a Single User To enable proxy access for a specific user, add the lines in the example box below to the user’s shell profile. For the default bash shell, the profile is the file ~/.bash_profile.
$ vi ~/.bash_profile# The Web proxy server used by this accounthttp_proxy="http://:"export http_proxyProfile Settings for Using a Proxy Server If the proxy server requires a username and password, add these to the URL. To include the username yum-user and the password qwerty, add these settings:
# The Web proxy server, with the username and password for this accounthttp_proxy="http://http://:@:"export http_proxyNOTE: This is really insecure as you will now have your proxy user id and password simple readable text format.