ubuntu给终端加代理服务器

ubuntu给终端加代理

访问google.com 是否可以访问通

curl https://www.google.com

如果访问不通说明代理服务器没有配置好。

使用 gedit ~/.bashrc 打开网络配置

gedit ~/.bashrc

找到文章的最后添加代理

export http_proxy='http://127.0.0.1:7890'
export https_proxy='http://127.0.0.1:7890'

出现 警告忽略

** (gedit:113947): WARNING **: 17:35:54.179: Set document metadata failed: 不支持设置属性 metadata::gedit-position

更新配置

source ~/.bashrc

检查是不是代理添加成功

root@sunyuhua-HKF-WXX:/home/sunyuhua/tools# curl https://www.google.com
<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="en"><head><meta content="Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for." name="description"><meta content="noodp" name="robots"><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google</title><script nonce="LCVtCDZ0Jiv9pM9xE5EzBw">(function(){var _g={kEI:'cT5TZbdf6NOQ8g_1yp_gDA',kEXPI:'0,795736,569732,206,4804,2316,383,246,5,1129120,1921,1195871,609,380090,16114,28684,22431,1361,12316,4749,12834,4998,17075,38444,2872,2891,3926,213,4210,3405,606,30668,30022,6397,8927,2025,1,16916,2652,4,32894,9871,16852,2980,1457,22601,6636,7596,1,42154,2,16395,342,3533,19491,5679,1021,31121,4569,6258,23418,1252,3

你可能感兴趣的:(ubuntu,linux,运维)