Install agent tools such as trojan and configure startup to obtain the port number
for example
10.10.1.10:8080
System Agent Settings
We will add a shell script file under/etc/profile.d/proxy.sh, which will ensure that the settings are applicable to all logged in users:
sudo vim /etc/profile.d/proxy.sh
Write the following content in the document:
# set proxy config via profie.d - should apply for all users
export http_proxy="http://10.10.1.10:8080/"
export https_proxy="http://10.10.1.10:8080/"
export ftp_proxy="http://10.10.1.10:8080/"
export no_proxy="127.0.0.1,localhost"
# For curl
export HTTP_PROXY="http://10.10.1.10:8080/"
export HTTPS_PROXY="http://10.10.1.10:8080/"
export FTP_PROXY="http://10.10.1.10:8080/"
export NO_PROXY="127.0.0.1,localhost"
Add execution permissions for this file:
sudo chmod +x /etc/profile.d/proxy.sh
Activate the file to start using proxy settings, or log out and log in again:
source /etc/profile.d/proxy.sh
#Check the environment variables to confirm if they are effective
env | grep -i proxy
Clear Network Proxy when you don't need it any more.
unset http_proxy
unset https_proxy
unset HTTP_PROXY
unset HTTPS_PROXY
Top comments (0)