Ticker

6/recent/ticker-posts

Advertisement

Set System Proxy on Ubuntu

 How To Set System Proxy on Ubuntu 20.04


If you are a new user of ubuntu and in your organization a proxy server for internet access. you need to set proxy in your ubuntu operating system use the following steps.

In Ubuntu operating systems, there are various option to configuring Proxy settings. The graphical interface can be used, or all settings are done on the command line.


If you need to set proxy in Firefox browser, click on Menu > Preferences > Network Settings > check the box "Manual Proxy configuration". and check the box also use this proxy for FTP and HTTPS click on OK.



Set System Proxy on GUI


1.Open Settings.




2. On Network options, edit Network Proxy settings.


3. On Network proxy select Manual and set the proxy with port for all options.



Set System Proxy settings using CLI



This will ensure the settings apply to all logged-in users. For the system proxy settings use command

sudo nano  /etc/profile.d/proxy.sh



Set the value and save the file using ctrl +x and press y.



Add other IPs if you want to exclude from proxy to NO_PROXY & no_proxy environment variable.

execute following command.

Type command sudo chmod +x  /etc/profile.d/proxy.sh and press enter. 


Type command source /etc/profile.d/proxy.sh and press enter. 


Type command env | grep -i proxy and press enter. 



Set proxy for APT package manager


The above mention settings will work for Applications and command-line tools. If you want to set proxy only for the APT package manager. use the following steps.

Type command sudo nano /etc/apt/apt.conf.d/proxy and press enter.


Set the value and save the file using ctrl +x and press y.

Acquire::http::proxy "http://10.0.0.226:8080/";
Acquire::https::proxy "https://10.0.0.226:8080/";
Acquire::ftp::proxy "ftp://10.0.0.226:8080/";


Replace 10.0.0.226 with your proxy server IP address. If Authentication is required, use the following steps and type username and password.

Acquire::http::proxy "http://<username>:<password>@<proxy>:<port>/";
Acquire::https::proxy "https://<username>:<password>@<proxy>:<port>/";
Acquire::ftp::proxy "ftp://<username>:<password>@<proxy>:<port>/";

Set Proxy for wget only


first install vim using command sudo apt install vim and press enter.


For set the proxy settings for use with wget command, add them to ~/.wgetrc file.


Press i for insert the value, type the value and save the file using ESC :wq

use_proxy = on
http_proxy = http://10.0.0.226:8080/ 
https_proxy = http://10.0.0.226:8080/ 
ftp_proxy = http://10.0.0.226:8080/


Post a Comment

0 Comments