Proxy settings in centos

Source: Internet
Author: User

Recently, a centos host is used on the campus network, and a proxy is required to connect to the network. If it is a windows host, set it in the Internet option, however, in the linux system where any configuration file needs to be changed, I am really confused. Now, let's summarize the configuration methods below. On the one hand, we will leave it to ourselves, and others will be able to avoid detours.

1. Global http Proxy

All users (the simplest and most direct configuration method. If you follow this configuration, you will not need to check it later)

Edit/etc/profile to add

http_proxy===

If you do not need the user name or password, you can leave it blank. You only need to enter the IP address and port, such as http: // 123.123.123.123: 8000.

Many related reprinted articles on the Internet have written export http_proxy as export_http_proxy.

Almost all the Internet users only write the http code. When running commands, they often do not even access the internet. Especially for some open-source projects on github, the addresses are https, therefore, you must add https entries. You can add ftp entries without any trouble.

Single User

Edit ~ /. Bash_profile Add the same content as above

http_proxy===

 

2. yum proxy (yum is the command for downloading software in centos. It is similar to apt-get In ubuntu. you can install most of the commonly used software only by configuring this command)

  Edit/etc/yum. conf to add

proxy=http:

If you do not need the same user name or password, you can leave it empty.

 

3. wget proxy (wget is used for downloading files, and the corresponding files can be downloaded using a url later)

Edit/etc/wgetrc to add

https_proxy = http:http_proxy = http:ftp_proxy = http:

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.