Use proxy to access the Internet on the Linux command line interface

Source: Internet
Author: User

In Linux, setting proxy to access the Internet only requires setting a user variable, which is very simple. There are several proxy methods:

Proxy Method

Variable name

HTTP Proxy Http_proxy
HTTPS Security Proxy Https_proxy
FTP Proxy Ftp_proxy
No proxy IP No_proxy

To set proxy, follow these steps:
[Inbi @ Debian ~] # Export http_proxy = itwhy: 123456@proxy.itwhy.org: 8080
# Http_proxy: indicates that HTTP proxy is used.
# Itwhy: the username used by the proxy #123456: password!
# Proxy.itwhy.org: proxy address, which can be an IP address or a domain name #8080: port used
# If you need to be permanently valid, you need to write the above command into the file! For example:
[Inbi @ Debian ~] # Echo "Export http_proxy = proxy.itwhy.org: 8888"> ~ /. Profile

For a single applicationProgramSet proxy
This is not a big deal. Let's take an example! Next I will set the lftp program Proxy:
[Inbi @ Debian ~] # Echo "Export http_proxy = proxy.itwhy.org: 8888"> ~ /. Lftp
# Haha. Open lftp again to download it!

Socks proxy-tsocks
[Inbi @ Debian ~] # Aptitude install tsocks
# Modify the configuration file as follows.
[Inbi @ Debian ~] # Vim/etc/tsocks. conf
Local = 192.168.1.0/255.255.255.0
# Local indicates the local network, that is, the network without the socks proxy
Server = 202.13.96.25
# SOCKS Server IP Address
Server_type = 5
# SOCKS service version
Server_port = 9999
# SOCKS service port
Tsocks usage:
[Inbi @ Debian ~] # Tsocks lftp
# Force lftp to connect to the network through socks proxy

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.