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