Home  >  Article  >  System Tutorial  >  How to set up proxy using CentOS command line

How to set up proxy using CentOS command line

WBOY
WBOYforward
2024-01-06 18:45:50910browse

Set the global proxy as follows:

1. Set relevant environment variables in the profile file

# vi /etc/profile

http_proxy=http://192.168.20.20:3128 #Specify the proxy server addresses used by http, https and ftp protocols respectively

export http_proxy

2. Source /etc/profile takes effect.

After the modification is completed, log out and log in again.

For the yum proxy, you must also set up the /etc/yum.conf file and add the following code:

proxy=http://username:password@yourproxy:8080/

#If there is no password restriction, the following method is used

#proxy=http://yourproxy:8080/

In this way, yum operations go through the proxy

The above is the detailed content of How to set up proxy using CentOS command line. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:jb51.net. If there is any infringement, please contact admin@php.cn delete