Proxy server configuration under Linux


James Hunt


Many programs under Linux only have command-line interface. For such programs, they access the network through proxy server in different ways. In this article, easwy summarizes some methods of configuring proxy server with common Linux programs.

[general proxy server configuration]

For most Linux console programs, such as apt get and aptitude commands, GIT commands, WGet commands in Debian or Ubuntu, these programs use HTTP_ Proxy and FTP_ Proxy environment variable to get the configuration of proxy service.

The method is in your ~ / Add words similar to the following in bashrc:

export http_ proxy= http://username:password @proxyserver:port/

export ftp_ proxy= http://username:password @proxyserver:port/ 

If you set up a Roxlabs proxy server for user name and password authentication, you need to fill in the username and passwd sections above. If it is whitelist authentication, omit these two sections.

For example, suppose your proxy server is 192.168 1.1. If the port is 8080, the user name is easy, and the password is 123456, these two environment variables should be set as follows:

export http_ proxy= http://easwy:123456 @192.168. 1.1:8080 

export ftp_ proxy= http://easwy:123456 @192.168. 1.1:8080 

After this configuration, exit and log in again, or directly use the following command source bashrc:

source ~/. bashrc

Now, the above program can access the network through the proxy server.

Recent posts