[root@localhost ~]# vi ~/.bashrc
# Network Config
export http_proxy=http://username:password@proxyserver:port
export https_proxy=http://username:password@proxyserver:port
export ftp_proxy=http://username:password@proxyserver:port
## 刷新一下
[root@localhost ~]# source ~/.bashrc
来源:oschina
链接:https://my.oschina.net/javamaster/blog/3159264