How to set up a proxy on the Linux operating system
- Feb 29, 2024, 12:37 AM
- 1 minute
Setting up proxies on Linux
To set up proxies on Linux, you need to launch the command line and enter one of the parameters below:
export http_proxy="http://proxy-server:port"
export https_proxy="https://proxy-server:port"
export socks_proxy="socks://proxy-server:port"
In these lines, proxy-server is the IP address provided to you. And port is the assigned port. As a result, the completed line may look like this:
export https_proxy="https:"http://138.128.58.157:8000"
If authentication is required for the proxy, use the following syntax:
export http_proxy="http://user:password@proxy-server:port"
export https_proxy="https://user:password@proxy-server:port"
export socks_proxy="socks://user:password@proxy-server:port"
If the password contains special characters, they need to be replaced with ASCII codes. Here is a table where you can find them.
For example, the @ symbol should be replaced with "%40".
Another option is to configure the connection through configuration files. To do this, you need to edit the /etc/environment file with root privileges and add the syntax:
http_proxy="http://user:pass@proxy:port/"
ftp_proxy="ftp://user:pass@proxy:port/"
socks_proxy="socks://user:pass@proxy:port/"
If the proxy does not require authentication, the lines should look like this:
http_proxy="http://proxy-server:port"
https_proxy="https://proxy-server:port"
socks_proxy="socks://proxy-server:port"
After applying the settings, restart your PC and then start the init process - the main process in the system from which all child processes will receive the proxy.
Disabling proxies on Linux
To do this, enter one of the parameters in the command line:
Unset http_proxy/
Unset ftp_proxy/
Unset http_proxy.
In OnlineProxy you will find mobile proxies from all over the world with daily billing from $0.7 and IP rotation. Proxies are great for work tasks. We guarantee quality or refund money.