Create proxy file using VIM or nano
sudo vim /etc/profile.d/proxy.sh
Populate your proxy values.
# set proxy config via profie.d - should apply for all users
# http/https/ftp/no_proxy
export http_proxy="http://192.10.1.20:8080/"
export https_proxy="http://192.10.1.20:8080/"
export ftp_proxy="http://192.10.1.20:8080/"
export no_proxy="127.0.0.1,localhost"
# For curl
export HTTP_PROXY="http://192.10.1.20:8080/"
export HTTPS_PROXY="http://192.10.1.20:8080/"
export FTP_PROXY="http://192.10.1.20:8080/"
export NO_PROXY="127.0.0.1,localhost"
Add any additional IP address to be excluded to the NO_PROXY & no_proxy environment variables. When done add execution bit to the script created.
sudo chmod +x /etc/profile.d/proxy.sh
Source the file for runtime use:
source /etc/profile.d/proxy.sh
Confirm proxy has been loaded in your environment.
$ env | grep -i proxy
No comments:
Post a Comment