AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[proxy](ubuntu)

Martin Hope
Gavin Mitchel Dundee
Asked: 2025-03-01 03:52:12 +0800 CST

为所有用户提供 cURL 代理

  • 5

如何为所有用户设置 cURL 的代理?

我知道我可以编辑 ~/.curlrc 文件并像这样添加代理:proxy = "http://myproxy.com:1112"

但我希望这适用于所有用户。

proxy
  • 3 个回答
  • 61 Views
Martin Hope
Olga Dymova
Asked: 2024-05-15 22:04:03 +0800 CST

配置 SQUID 代理以进行身份​​验证、全局访问和用户特定的日志记录

  • 6

我正在寻找有关在 Ubuntu 上设置 SQUID 代理服务器的一些指导,条件如下:

  1. 访问应仅限于 中列出的经过身份验证的用户/etc/squid/passwords,这是通过以下方式实现的:
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords

用户通过以下方式添加

sudo htpasswd /etc/squid/passwords username
  1. 代理应该允许从世界各地的任何位置进行访问(配置文件中的哪一行控制这一点?我怀疑http_access deny设置http_access allow可能会发生冲突,我特别请求有关这一点的帮助)。
  2. 代理应该只处理 HTTP 和 HTTPS 流量,不包括其他协议(我相信 ACL 设置控制这一点)。
  3. 日志记录应该是基于/etc/squid/passwords监视单个用户活动的特定于用户的(在这种情况下“组合”意味着什么?):
access_log /var/log/squid/access.log combined

我想创建一个简约的配置文件来满足这些要求,但每当我设法满足列表中的一项要求时,另一项就会停止工作,依此类推。这让我发疯...提前致谢!

proxy
  • 1 个回答
  • 22 Views
Martin Hope
Anatoly Frolov
Asked: 2023-12-07 23:17:09 +0800 CST

3proxy,普通 HTTP 代理,“连接失败”

  • 6

我正在尝试按照开发人员网站上的说明以及互联网上的教程在 Ubuntu 22.04 上配置 3proxy。我需要一个标准的 HTTP 代理。允许所有 HTTP 和 HTTPS 端口,但我收到错误:

$ curl -x http://username:[email protected]:3128 https://ifconfig.io
curl: (7) Failed to connect to 192.168.1.47 port 3128 after 30 ms: Connection refused

这是我的配置 /etc/3proxy/3proxy.cfg

nscache 65536
nserver 192.168.1.1
config /conf/3proxy.cfg
monitor /conf/3proxy.cfg
counter /count/3proxy.3cf
users $/conf/passwd
include /conf/counters
include /conf/bandlimiters
auth strong
deny * * 127.0.0.1
allow * * * 80 HTTP # HTTP & HTTPS are allowed!
allow * * * 443 HTTPS # HTTP & HTTPS are allowed!
proxy -n -p 3128 -a # 3128 PORT!
flush
allow

我无法弄清楚带有用户和密码的配置存储在哪里?我通过添加用户

add3proxyuser.sh <username> <password>

也许防火墙有问题?但我没有安装防火墙软件。

proxy
  • 1 个回答
  • 17 Views
Martin Hope
Abol
Asked: 2022-11-28 13:30:21 +0800 CST

错误:由于 OSError 无法安装软件包:解析失败:代理:端口

  • 5

我想使用 pip3 安装一个包,但那发生了:

Ubuntu@User:~$ pip3 install <package-name>
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not install packages due to an OSError: Failed to parse: https://<proxy>:<port>/

有人可以帮我做什么吗?我认为我应该更改代理设置,但是如何更改?

proxy
  • 1 个回答
  • 31 Views
Martin Hope
Sayaman
Asked: 2022-03-29 16:10:43 +0800 CST

你如何检查你是否在代理服务器上?

  • 0

你如何检查你是否在代理服务器上?我注意到我无法在我的登台服务器上安装任何东西,我记得有一些奇怪的配置是为了保护它不受外人的影响,所以我认为我在代理后面。那么如何检查,以及如何知道代理是否在 Amazon 上并获取我可能需要配置 Composer 才能工作的其他信息。

proxy
  • 1 个回答
  • 119 Views
Martin Hope
jjjkkkjjj
Asked: 2020-11-25 18:49:34 +0800 CST

奇怪的 apt(-get) 代理身份验证行为

  • 1

我已经在我公司的 PC 上安装了 Ubuntu18.04。我已经设置了通过公司代理连接互联网的配置,例如;

/etc/environment

http_proxy="http://user%40domain:[email protected]:port/"
https_proxy="https://user%40domain:[email protected]:port/"
ftp_proxy="ftp://user%40domain:[email protected]:port/"

/etc/apt/apt.conf

Acquire::http::Proxy "http://user%40domain:[email protected]:port/";
Acquire::https::Proxy "https://user%40domain:[email protected]:port/";
Acquire::ftp::Proxy "ftp://user%40domain:[email protected]:port/";

然后我可以连接互联网并执行 apt 命令,例如sudo apt-get update.

但是当第二天来临时,我不能做 apt 命令。

Err:1 http://ftp.riken.jp/Linux/ubuntu bionic InRelease
  407  Proxy Authentication Required [IP: proxy.ip port]
Err:2 http://ftp.riken.jp/Linux/ubuntu bionic-updates InRelease  
  407  Proxy Authentication Required [IP: proxy.ip port]
Err:3 http://ftp.riken.jp/Linux/ubuntu bionic-backports InRelease
  407  Proxy Authentication Required [IP: proxy.ip port]
Err:4 http://ftp.riken.jp/Linux/ubuntu bionic-security InRelease               
  407  Proxy Authentication Required [IP: proxy.ip port]

但!!如果我从 GUI 打开 firefox,这个问题就解决了……太奇怪了,我无法理解这种行为……

Firefox 设置为Use system proxy settings.

我向我公司的代理服务器管理员询问了这个问题,我们的代理服务器似乎每晚都会重新启动。您能否解释一下为什么会发生这种行为以及如何在不打开 Firefox的情况下每天执行 apt 命令?

networking firefox apt proxy
  • 1 个回答
  • 459 Views
Martin Hope
codlord
Asked: 2020-08-02 04:24:04 +0800 CST

可以配置(Squid)代理,以便浏览器可以绕过 VPN?

  • 2

我想做以下事情(如果可能的话):

正常使用 1 个浏览器(比如 Firefox) - 所有流量都使用我的 VPN。有另一个浏览器(比如 Chrome),所有流量都会绕过 VPN。

我已经使用 OpenVPN 设置了带有 VPN 的 PC,并且我了解如何添加静态路由,以便对特定 IP 地址的访问将绕过 VPN。

我认为我想做的可能是通过设置一个(Squid)代理服务器来路由 VPN 之外的所有流量,然后配置 Chrome 浏览器以使用该代理服务器。除非有更好/更简单的方法?

但是我不知道如何完成这个并配置 Squid/routes 尽管做了很多阅读和实验(我不是网络专家),我也无法找到任何资源来告诉我如何(或者如果可能的话) .

任何帮助或信息链接表示赞赏。

networking vpn proxy squid openvpn
  • 3 个回答
  • 2459 Views
Martin Hope
N0rbert
Asked: 2020-07-19 03:04:19 +0800 CST

为什么在使用配置的 squid-deb-proxy 客户端从 19.10 到 20.04 LTS 运行 do-release-upgrade 时出现“身份验证失败”?

  • 4

我正在squid-deb-proxy本地网络中运行服务器。在运行所有 APT 命令时,它适用于所有包下载。它针对镜像的所有可能已知 URL 进行配置,包括old-releases。Ubuntu 19.10 客户端已安装客户端 -squid-deb-proxy-client软件包。

$ dpkg -l squid-deb-proxy-client | tail -n1
ii  squid-deb-proxy-client 0.8.14+nmu2  all          automatic proxy discovery for APT based on Avahi

$ sudo apt update 
Hit:1 http://archive.ubuntu.com/ubuntu eoan InRelease
Hit:2 http://archive.ubuntu.com/ubuntu eoan-updates InRelease
Hit:3 http://archive.ubuntu.com/ubuntu eoan-backports InRelease
Hit:4 http://security.ubuntu.com/ubuntu eoan-security InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.

但是当我尝试开始升级过程以获得 20.04 LTS -sudo do-release-upgrade在终端中使用时,我收到以下错误消息:

$ sudo do-release-upgrade 
Checking for a new Ubuntu release
Your Ubuntu release is not supported anymore.
For upgrade information, please visit:
http://www.ubuntu.com/releaseendoflife

Get:1 Upgrade tool signature [1 554 B]                                                                                                              
Get:2 Upgrade tool [1 342 kB]                                                                                                                       
Fetched 1 343 kB in 0s (0 B/s)                                                                                                                      
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
Authentication failed
Authenticating the upgrade failed. There may be a problem with the network or with the server. 

squid-deb-proxy我在服务器端的日志中没有看到任何特别之处:

==> /var/log/squid-deb-proxy/access.log <==
1595069772.862    212 192.168.3.47 TCP_MISS/200 3349 CONNECT changelogs.ubuntu.com:443 - HIER_DIRECT/91.189.95.15 -
1595069774.726      2 192.168.3.47 TCP_MEM_HIT/200 1950 GET http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz.gpg - HIER_NONE/- application/x-gzip
1595069775.410    681 192.168.3.47 TCP_HIT/200 1342082 GET http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz - HIER_NONE/- application/x-gzip

我应该如何解决身份验证无法通过代理服务器正常运行升级的问题?我不想关闭代理服务器(或从客户端排除其配置)来解决问题。


笔记:

  1. 对于可能的近距离投票者:当我尝试使用sudo do-release-upgrade -d.
  2. 我已向启动板报告错误 1888058。
  3. 删除deb-package 并通过insquid-deb-proxy-client指定代理不会改变任何内容。Acquire::http::Proxy "http://192.168.12.34:8000";/etc/apt/apt.conf
upgrade apt proxy 20.04 19.10
  • 2 个回答
  • 3284 Views
Martin Hope
Stanislav
Asked: 2020-07-09 06:56:42 +0800 CST

resolv.conf 和 linux DNS 是如何工作的?

  • 2

我在使用 docker 网络(特别是自定义 DNS 代理设置)时遇到了一些问题,我发现我的 resolv.conf 有点奇怪:

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.

  nameserver 172.17.0.1
  nameserver 10.0.0.10
nameserver 127.0.0.53

因此,3d 方自定义 DNS 代理基本上将第三个 IP 更改为如下所示:

#nameserver 127.0.0.53
nameserver [proxy-dns-entry-ip]

我在这个 DNS 下对主机名的所有请求都被打破10.0.0.10了nslookup:

$ nslookup container1.hostname           

;; Got recursion not available from 172.17.0.1, trying next server
Server:     10.0.0.10
Address:    10.0.0.10#53

** server can't find container1.hostname: NXDOMAIN
$ nslookup container1.hostname [proxy-dns-entry-ip]

Server:     192.168.144.3
Address:    192.168.144.3#53

Non-authoritative answer:
Name:   container1.hostname
Address: 192.168.128.3
Name:   container1.hostname
Address: 192.168.128.3

我已经编辑了文件,只是注释掉了前两个 IP 地址,并且新的 DNS 工作正常,当这个代理被禁用并且唯一的条目是127.0.0.53时,主机网络也工作正常(比如,我可以 ping google并使用我的浏览器),码头工人和容器也在工作。

我对网络很陌生(尤其是 Linux)。有人可以向我解释这 3 个地址发生了什么以及它们如何与 ubuntu 的 DNS 服务器耦合(我的意思是我在 GUI 网络设置中定义的那些)?

networking dns proxy docker
  • 1 个回答
  • 5675 Views
Martin Hope
WiGeeky
Asked: 2020-06-18 02:12:29 +0800 CST

如何在 Ubuntu 中将 Docker 与 socks5 一起使用?

  • 1

我一直在尝试通过本地 socks5 代理运行 docker,我尝试将环境变量设置为:

export ALL_PROXY=127.0.0.1:1080

但这并没有什么区别,就好像 Docker 没有阅读它一样,我也尝试将配置放入~/.docker/config.json:

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "socks5://127.0.0.1:1080"
   }
 }
}

但这也不起作用。有什么问题,如何在 Ubuntu 上使用 socks5 代理运行 Docker?

systemd proxy docker
  • 2 个回答
  • 3834 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve