USTAWIENIA PROXY - DEBIAN/UBUNTU

ODPOWIEDZ
Awatar użytkownika
admin
Site Admin
Posty: 40
Rejestracja: piątek 15 maja 2020, 08:13
Lokalizacja: Wrrocław
Kontakt:

USTAWIENIA PROXY - DEBIAN/UBUNTU

Post autor: admin »

https://computingforgeeks.com/how-to-se ... tu-debian/

Set System-Wide Proxy settings on CLI

We will add a shell script file under /etc/profile.d/proxy.sh. This will ensure the settings apply to all logged-in users.
sudo nano /etc/profile.d/proxy.sh
Populate your proxy values.
# set proxy config via profie.d - should apply for all users
#
export http_proxy="http://10.10.1.10:8080/"
export https_proxy="http://10.10.1.10:8080/"
export ftp_proxy="http://10.10.1.10:8080/"
export no_proxy="127.0.0.1,localhost"

# For curl
export HTTP_PROXY="http://10.10.1.10:8080/"
export HTTPS_PROXY="http://10.10.1.10:8080/"
export FTP_PROXY="http://10.10.1.10:8080/"
export NO_PROXY="127.0.0.1,localhost"
Add other IPs you want to exclude from proxy to NO_PROXY & no_proxy environment variable.

Make it executable.
sudo chmod +x /etc/profile.d/proxy.sh
Source the file to start using the proxy settings, or alternatively logout and back in.
$ source /etc/profile.d/proxy.sh
Confirm:
$ env | grep -i proxy
Set proxy for APT package manager

The above settings will work for Applications and command-line tools. If you want to set proxy only for the APT package manager, configure like below.
$ sudo nano /etc/apt/apt.conf.d/80proxy

Acquire::http::proxy "http://10.10.1.10:8080/";
Acquire::https::proxy "https://10.10.1.10:8080/";
Acquire::ftp::proxy "ftp://10.10.1.10:8080/";
Replace 10.10.1.10 with the correct IP address for your proxy servers. If Authentication is required, set like this.
Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";
Ręczne odpalenie proxy na czas sesji:

dla http
export http_proxy='http://194.181.104.48:3128'
oraz dla https
export https_proxy='https://194.181.104.48:3128'[
ODPOWIEDZ