1.首先新建一个bash文件
vim /etc/profile.d/proxy.sh 加入以下内容 (有账号密码) export HTTP_PROXY="https://username:[email protected]:808/" export FTP_PROXY="https://username:[email protected]:808/" export no_proxy=127.0.0.1,192.168.,localhost use_proxy=on (无账号密码) export HTTP_PROXY="https://192.168.1.1:808/" export FTP_PROXY="https://192.168.1.1:808/" export no_proxy=127.0.0.1,192.168.,localhost use_proxy=on 注: ip和端口自行替换。 保存(新建)退出vim /etc/profile.d/pro