
- No username and password required: To configure proxy without username and password:
export http_proxy=http://SERVER:PORT/ - Username and password authentication: To configure the proxy server with username and password authentication:
export http_proxy=http://USERNAME:PASSWORD@SERVER:PORT/
Method 1 β Using /etc/environment - Set up http proxy permanently using /etc/environment | |
====================================================================== | |
http_proxy="http://myproxy.server.com:8080/" | |
https_proxy="http://myproxy.server.com:8080/" | |
ftp_proxy="http://myproxy.server.com:8080/" | |
no_proxy="localhost,127.0.0.1,localaddress,.localdomain.com" | |
HTTP_PROXY="http://myproxy.server.com:8080/" | |
HTTPS_PROXY="http://myproxy.server.com:8080/" | |
FTP_PROXY="http://myproxy.server.com:8080/" | |
NO_PROXY="localhost,127.0.0.1,localaddress,.localdomain.com" | |
Method 2 β Using yum.conf - Setting proxy for other programs such as yum | |
====================================================================== | |
vi /etc/yum.conf | |
# vi /etc/yum.conf | |
proxy=http://proxy.example.com:3128 | |
proxy_username=yum-user | |
proxy_password=qwerty | |
Method 3 β Using /root/.bashrc | |
====================================================================== | |
export http_proxy=username:password@proxyhost.com:8080 | |
export https_proxy=username:password@proxyhost.com:8081 | |
export no_proxy=localhost, 127.0.0.1, *.my.lan | |
Method 4 β apt-get, aptitude, etc | |
====================================================================== | |
apt-get, aptitude, etc. will not obey the environment variables when used normally with sudo. So separately configure them; create a file called 95proxies in /etc/apt/apt.conf.d/, and include the following: | |
Acquire::http::proxy "http://myproxy.server.com:8080/"; | |
Acquire::ftp::proxy "ftp://myproxy.server.com:8080/"; | |
Acquire::https::proxy "https://myproxy.server.com:8080/"; |
Iβm a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND