The method I describe below was obtained by translating an article into Spanish on Arch Wiki about using a proxy. This method must be perfectly valid for any other distribution.
Some programs (like wget) use environment variables of the form "protocol_proxy" to determine the representation of a certain protocol (for example, HTTP, FTP, ...).
Here is an example of how to set these variables:
If we want to make the aforementioned proxy environment variables available to all users, we can add script, for example "Proxy.sh"Within /etc/profile.d/. The script must have execute permissions.
# chmod +x /etc/profile.d/proxy.sh
Alternatively, you can automate the switching of variables by adding a function to your file .bashrc as follows:
echo -n "username:"
read -e username
echo -n "password:"
read -es password
echo -e "\nProxy environment variable set."
echo -e "\nProxy environment variable removed."