The process of setting up a proxy on Linux may vary depending on the Linux distribution. The following instructions have been tested on Centos 7.9 and Ubuntu 20.04.
Environment Variables | Description |
---|---|
http_proxy | Specify a proxy server for routing HTTP traffic. |
https_proxy | Specify a proxy server for routing HTTPS traffic |
ftp_proxy | Specify a proxy server for routing FTP traffic |
all_proxy | Specify a proxy server for routing all traffic |
no_proxy | Host or domain names that do not require proxies. Wildcard characters can be used |
Proxy Settings For Current User
Temporary Proxy Settings
Temporary Proxy Settings
You can simply set up proxy settings for routing HTTP and HTTPS traffic for the current user by using the following command. Don’t forget to replace username, password, proxy_server, and port with yours.To remove proxy settings, simply use following command:
Bash
Permanent Proxy Settings
Permanent Proxy Settings
By adding the export command to the .bashrc file, you can ensure that this command is executed every time a new non-login shell is started. By default, .bashrc is sourced by .bash_profile to ensure that configurations in .bashrc are also applied to login shells.
Global Proxy Settings
Global proxy settings will affect every user in the Linux operating system. Please confirm the impact and decide whether to configure them or not..