Linux hosts network connections via proxy server

Source: Internet
Author: User
Tags git commands

We all know how to set up a connection proxy server through a proxy server under Windows, browser----> Tools------>internet Options-----> Connect---> LAN settings-------> tick " Use a proxy server for your LAN, configure the IP and port number of the proxy server. Ok. It is possible to browse the Web through a proxy server under Windows System.

But how do we go through a proxy server for network connectivity under Linux?

As we all know, the command window is prevalent in Linux, and many programs have only command-line windows. This also results in different settings for each program to connect to the network through a proxy server.

Below are some of the most common settings for Linux to connect to a network through a proxy server under a simple configuration.

"Common Proxy server Settings"

for most Linux console programs, such as apt-get and Aptitudecommands,git commands, wgetcommand, these programs all use the http_proxy and ftp_proxy environment variable to get the configuration of the proxy service.

The way is to add 2 variables in your profile (you can/etc/profile,/etc/bashrc,~/bashrc,~/.profile, etc., can be set according to your own situation, it is recommended to set in ~/BASHRC)

Export Http_proxy=http://username:[email protected]:p ort/

Export Ftp_proxy=http://username:[email protected]:p ort/

If your proxy server requires a user name and password to access, fill in username and password, if not, you can omit it. Like what:

Export http_proxy= Http://abcde:[email protected]:8080

Export Ftp_proxy=http://abcde:[email protected]:8080

Proxy Server login user name: ABCDE Password: 123456

Proxy server address: 192.168.100.1 port: 8080 (can be specified in proxy server)

Save exit.

Exit under terminal, or direct source ~/.BASHRC loaded in the file, is the environment variable in effect.


[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:


Http-proxy-host = 192.168.100.1

Http-proxy-port = 8080

Http-proxy-username = ABCDE

Http-proxy-password = 123456

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://abcde:[email protected]:8080


Now it's ready to use with Yum.



This article is from "Linux rookie" blog, please be sure to keep this source http://ludihua.blog.51cto.com/4601284/1602469

Linux hosts network connections via proxy server

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.