sudo网络权限
背景 对于设置了网络代理的服务器,在当前用户下执行网络访问没有问题,但通过sudo执行命令时,就会出现“无网络连接”的错误。 普通权限下,wget成功。 # wget https://github.com --2016-12-08 09:00:43-- https://github.com/ Connecting to 109.105.113.200:8080... connected. Proxy request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html’ 2016-12-08 09:01:03 (1.33 KB/s) - ‘index.html’ saved [25692] 使用sudo命令后,连接失败。 # sudo wget https://github.com --2016-12-08 09:01:41-- https://github.com/ Resolving github.com (github.com)... failed: Name or service not known. wget: unable to resolve host address ‘github.com’ 解决方案 出现这种情况的原因