ubuntu - Ubuntu server 18.04 LTS does not use the proxy anymore
问题描述
I have a Problem with one of my Servers. I am using one Proxy, but the Server does not accept the Proxy and tries to directly connect to the Internet. I checked where the Server wants to connect, thats how i know it is no Network issue. My Routing and Firewall works correct.
I tried to Google for the Problem but I did not find a solution. My guess is that I am missing one Setting where the Proxy should be entered.
This is what I did:
Proxy in /etc/Environment for the whole system
http_proxy="http://192.168.1.10:8080" ftp_proxy="ftp://192.168.1.10:8081"
Added the Proxy in /etc/apt/apt.conf AND /etc/apt/apt.conf.d/proxy.conf since I Read thet the file changed with 18.04 LTS:
Acquire::http::Proxy "http://192.168.1.10:8080";
Tried to add the Proxy in the terminal:
export http_proxy="http://192.168.1.10:8080" export ftp_proxy="http://192.168.1.10:8081"
Here is an example for one issue:
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys *****
I get a timeout when I enter this command (with the correct key). My DNS works, I get the correct IP for all Servers and everything I want to connect to.
Can anyone help me? Thats all I found which I could try. When I had ubuntu Server 16.04 LTS, way 3 was enough to work, and way 1 was needed if I did not want to insert the Proxy in each session.
解决方案
This needs a lot of investigation. At first, are you sure your proxy is connected to the internet and, more importantly, forwarding the traffic correctly? if so, then you need to check whether your proxy is allowing http, https, and ftp traffics. Pinging the proxy server from your client would be useful to make sure you have access to the proxy server and no filter is applied.
After going through the abovementioned, you have to make sure your server is passing "https" traffic through the proxy, in your case, you didn't explicitly enter the https_proxy in your Environment neither apt.conf.
consider the following: in apt.conf add:
Acquire::https::proxy "http://192.168.1.10:8080";
in your environment file add:
https_proxy="http://192.168.1.10:8080"
If you want to export your proxy then consider exporting https_proxy:
export https_proxy="http://192.168.1.10:8080"
推荐阅读
- c - UndefinedBehaviorSanitizer 因为空指针
- spring-boot - 尝试从部署的任何进程启动实例时出错
- python - 当我想在单元测试中使用反向函数时,会发生 django urls.exceptions.NoReverseMatch 错误?
- java - 字符串替换方法是否使用正则表达式?
- python - Pandas - 使用循环操作和组合多个数据帧
- python - 带有正则表达式的 Python For 循环
- sql - PostgreSQL:有没有办法将我的数据一块一块地插入到空表中以减少加载时间?
- c# - 在列表中获取响应。将 sql 更改为 Linq 查询以聚合数据
- google-apps-script - 嘿,如何在电子邮件中将值 [1] 设为粗体,如何更改文本的颜色?
- java - 由其他线程更新 javafx 上的 listview