Home > Linux > RedHat RHEL 6 system wide proxy settings

RedHat RHEL 6 system wide proxy settings

When you need to have proxy connection available to whole system, so dont bother with settings for firefox, yum proxy and similar, its simple as just plain file 😉

just copy & paste following code to terminal window. if you need other shell , like csh , just add another file with csh extension.
This should work for every user on system.
/bin/cat <<EOF > /etc/profile.d/proxy.sh
export http_proxy=http://host.name:port/
export ftp_proxy=http://host.name:port/
export HTTP_PROXY=http://host.name:port/
export FTP_PROXY=http://host.name:port/
export no_proxy=.localdomain.com
EOF
In case , that you want enable proxy access to only specific user, just add lines to his bash-profile file
echo "export http_proxy=http://hostname.or.ip:port"  >> /user_home/.bash_profile
  • just change hostname/ip to your hostname/ip of proxy server eg. myproxy.company.sk:8080
  • user_home is path to user home directory eg. /home/miki
hope it helps 😉

 

Categories: Linux Tags: , , , ,
  1. Max_valentine
    July 12th, 2013 at 18:05 | #1

    Thanks Buddy,
    I was behind a proxy but the yum server was at the internal Network.
    Only thing i was missing was no_proxy.
    And now, when i did it, i am able to run a yum update.
    I really did work and i was stuck here since last 2 days

  2. akshay
    September 24th, 2014 at 14:45 | #2

    Don’t you think the right hand side of = should be quoted, as it is a string value ?

  3. June 21st, 2015 at 14:44 | #3

    Hi,

    I’ve added a few bits around your proxy.sh, i.e. testing access to the proxy.
    Check out the post here:
    http://confluence.wartungsfenster.de/display/Adminspace/Shell+proxy+autoconfiguration

    One thing I think someone needs to do is adding in WPAD support. If you ever tinker with that, please blog it!

  1. No trackbacks yet.

%d bloggers like this: