proxy beállítás

Sziasztok!

Van két különböző szerver. Az egyik egy Elastix (PBX, VOIP...), a másik egy Observium (SNMP, Syslog..). Az első CentOS ha jól emlékszem, a második Turnkey Linux alapú, így egyben le lehet tölteni az installert. Rendben működik minden de nincs internet hozzáférésük és a frissítések miatt az néha nem ártana.

Sajnos arra nincs lehetőség, hogy addig adok neki fizikailag internetet, mert egy Win serveren megy virtualizálva proxy mögött. Tudtommal a Hyper-V nem is tud USB hálókártyát (pl wifi kártyát) átadni a virtuális gépnek. VirtualBox esetén ez működött, de céges környezetben Hyper-V-t használunk.

Elastix esetén valamikor régebben valahogy sikerült valamennyire beállítani de nagyon homályos a kép már, hogy akkor mit és hogyan csináltam, de ez nem is olyan fontos.

Fontosabb lenne az Observium frissítése. Próbáltam beállítani néhány helyen:

/etc/environment
https_proxy="http://myproxy.server.com:8080/"
ftp_proxy="http://myproxy.server.com:8080/"
HTTPS_PROXY="http://myproxy.server.com:8080/"
FTP_PROXY="http://myproxy.server.com:8080/"
no_proxy...

/etc/apt/apt.conf
Acquire::http::Proxy "http://USERNAME:PASSWORD@SERVER:PORT";
Acquire::https::Proxy "https://USERNAME:PASSWORD@SERVER:PORT";

A gond valószínűleg onnan ered, hogy a felhasználónévben van egy @ karakter. Valahogy így néz ki:

felhasználónév: user@domain.com
jelszó: valami

Próbáltam beírni \@ formátumban és %40 formában is, próbáltam idézőjelek között (mint ahogy fent írtam a példában) és idézőjel nélkül is.

Amit nem próbáltam még:

/etc/bash.bashrc
export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
export ftp_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/

Illetve aposztrófot használni idézőjel helyett. Érdekes egyébként, hogy van olyan rész, ami működik. Programokat tudok telepíteni. Ha w3m-el megpróbálok megnyitni egy weboldalt, akkor kiírja, hogy wrong username or password viszont bekéri a felhasználónevemet, majd a jelszavamat a proxyhoz. Ha megadom neki szépen egyszerűen kukaccal írva, akkor elfogadja és tudok netezni.
Feltételezem, ha jól lenne beállítva rendszerszinten a proxy, akkor a böngésző nem kérné.

Ez az opció (simán beírva a felhasználónevet) viszont nem jöhet szóba az általam ismert és fent leírt config fájlok esetén, mert ugye alapvetően a @ karakter választja el a hostname-et a username:password párostól.

Mit csináltam rosszul?


root@observium ~# apt-get update
Ign:1 http://archive.turnkeylinux.org/debian stretch-security InRelease
Ign:2 http://archive.turnkeylinux.org/debian stretch InRelease
Ign:3 http://archive.turnkeylinux.org/debian stretch-security Release
Hit:4 http://security.debian.org stretch/updates InRelease
Ign:5 http://archive.turnkeylinux.org/debian stretch Release
Ign:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Ign:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Ign:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:12 http://cdn-fastly.deb.debian.org/debian stretch InRelease
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Ign:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Ign:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Ign:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Ign:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
Hit:13 http://cdn-fastly.deb.debian.org/debian stretch Release
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Ign:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Ign:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Ign:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Err:6 http://archive.turnkeylinux.org/debian stretch-security/main amd64 Packages
407 Proxy Authentication Required
Ign:7 http://archive.turnkeylinux.org/debian stretch-security/main all Packages
Ign:8 http://archive.turnkeylinux.org/debian stretch-security/main Translation-en
Ign:9 http://archive.turnkeylinux.org/debian stretch/main all Packages
Err:10 http://archive.turnkeylinux.org/debian stretch/main amd64 Packages
407 Proxy Authentication Required
Ign:11 http://archive.turnkeylinux.org/debian stretch/main Translation-en
Reading package lists... Done
W: The repository 'http://archive.turnkeylinux.org/debian stretch-security Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: The repository 'http://archive.turnkeylinux.org/debian stretch Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://archive.turnkeylinux.org/debian/dists/stretch-security/main/binary-amd64/Packages 407 Proxy Authentication Required
E: Failed to fetch http://archive.turnkeylinux.org/debian/dists/stretch/main/binary-amd64/Packages 407 Proxy Authentication Required
E: Some index files failed to download. They have been ignored, or old ones used instead.

Hozzászólások

Ez ntlm alapú proxy autenktikáció?

Próbáltam, nem működött. Viszont itt felmerül egy olyan kérdés, hogy a cntlm beállításai felülírják-e a globális beállításokat vagy ki/mi az elsődleges ilyenkor? Mert jelenleg elég sok helyen van proxy beállítva.

1. az observium webes felületén
2. a webmin webes felületén
3. az observium "configuration console"-jában
4. /etc/environment
5. /etc/apt/apt.conf.d/01turnkey
6. /etc/apt/apt.conf.d/08proxy
7. /etc/wgetrc

Jelenlegi tudomásom szerint a /etc/environment-nek elégnek kellene lennie önmagában is.

Biztos, hogy letölt valamit valahonnan, mert tudok telepíteni programokat. Ha kikapcsolom ezeket, akkor semmit nem tudok telepíteni és nem is frissül az apt.

Escape-elni kell a felhasználónevet (rfc 3986), így: user%40domain.com

// Happy debugging, suckers
#define true (rand() > 10)

Így van most beírva az /etc/environment fájlban. Van ahol láttam, hogy nincs az URL végén / jel, van ahol van. Van ahol idézőjellel írják, van ahol anélkül. A webmin felületen is be lehet állítani proxyt és az Observium felületén is na meg ott a konzol. Vajon mi a prioritás vagy egyik a másikat felülírja? Tudom, ez már disztro specifikus, ezért sokkal nehezebb lesz megtalálni a megfelelő megoldást. Eleinte csak konzolban próbáltam, de már a webes felületre is rászálltam. Hátha segít.