Ubuntu 设置代理

 

cts@cts-pc:~$ vi ~/.bashrc
export http_proxy="http://username:password@proxyhk.hxxxxi.com:8080/"
export https_proxy="http://username:password@proxyhk.hxxxxi.com:8080/"
cts@cts-pc:~$ source ~/.bashrc
cts@cts-pc:~$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz
--2021-01-05 19:41:18--  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz
Resolving proxyhk.huawei.com (proxyhk.huawei.com)... 172.18.32.221
Connecting to proxyhk.huawei.com (proxyhk.huawei.com)|172.18.32.221|:8080... connected.
ERROR: cannot verify artifacts.elastic.co's certificate, issued by ‘CN=Huawei Web Secure Internet Gateway CA,OU=IT,O=Huawei,L=Shenzhen,ST=GuangDong,C=cn’:
  Unable to locally verify the issuer's authority.
To connect to artifacts.elastic.co insecurely, use `--no-check-certificate'.
cts@cts-pc:~$
cts@cts-pc:~$ wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz --no-check-certificate
--2021-01-05 19:41:54--  https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.6.2-linux-x86_64.tar.gz
Resolving proxyhk.huawei.com (proxyhk.huawei.com)... 172.18.32.221
Connecting to proxyhk.huawei.com (proxyhk.huawei.com)|172.18.32.221|:8080... connected.
WARNING: cannot verify artifacts.elastic.co's certificate, issued by ‘CN=Huawei Web Secure Internet Gateway CA,OU=IT,O=Huawei,L=Shenzhen,ST=GuangDong,C=cn’:
  Unable to locally verify the issuer's authority.
Proxy request sent, awaiting response... 200 OK
Length: 296477546 (283M) [application/x-gzip]
Saving to: ‘elasticsearch-7.6.2-linux-x86_64.tar.gz’

 

password中不能有类似@特殊字符,否则必须使用转义字符:比如@ => %40 即%+Hex(十六进制)

其他常见的%转义字符有:
! # $ & ' ( ) * + , / : ; = ? @ [ ]
%21 %23 %24 %26 %27 %28 %29 %2A %2B %2C %2F %3A %3B %3D %3F %40 %5B %5D

posted @ 2021-01-05 19:49  牧 天  阅读(513)  评论(0)    收藏  举报