There are many programs under Linux that have only command-line interfaces, and for such programs, they can access the network through a proxy server in different ways. In this paper, Easwy summarizes some common Linux programs to configure Proxy server methods.
[General Proxy Server Configuration]
For most Linux console programs, such as apt-get and aptitude commands in Debian or Ubuntu, git commands, wget commands, these programs use http _proxy and ftp_proxy environment variables to get the configuration of the proxy service.
The method is to add something like the following to your ~/.BASHRC:
If your proxy server requires a user name and password to access, you need to fill in the username and passwd sections above, otherwise, omit these two parts.
For example, suppose your proxy server is 192.168.1.1, the port is 8080, the user name is easwy, the password is 123456, Then you should set these two environment variables:
After this configuration, exit and log in again, or use the following command directly to source. BASHRC:
SOURCE ~/.BASHRC
The above program can now access the network through a proxy server.
[Proxy server configuration for subversion]
To configure the proxy server for subversion, you need to modify the $HOME/.subversion/servers file in the [Global] section of this file plus:
Now SVN can use the proxy server to access the repository.
[Configuration of the proxy server for Yum]
If you want Yum in CentOS to be able to update the program through a proxy server, you need to modify the file /etc/yum.conf, which is added in this file:
Proxy=http://easwy:[email protected]:8080
Now you can update your software with yum .
original article, please read the footer of the licensing method, reproduced Please specify: reproduced from the Easy Water Blog [http://easwy.com/blog/]
This article link address: http://easwy.com/blog/archives/proxy-setting-on-linux-console/
Proxy configuration for common programs under linux--