This article will introduce you the command line method to change proxy settings on Ubuntu desktop.
Change Ubuntu desktop proxy settings from command line
To change the system proxy setting in Ubuntu from the command line, we use the gsettings. The gsettings is a command line tool used in Ubuntu to change database settings. gsettings in Ubuntu allow users to monitor or set keys for changes; It is used to manage the settings of the applications
To change the proxy settings on the Ubuntu system, use the command mentioned below to run the gsettings Tool:
Once the gsetting Tool is launched, you can easily change the proxy settings by following the syntax of the commands below:
Now I will use above commands to change proxy settings for each; HTTP, HTTPS, FTP and socks.
For “HTTP” proxy
HTTP proxy is used to identify suspicious web content coming from an untrusted source. It is required in Ubuntu to protect the HTTP server from various attacks. To set up the HTTP proxy settings, run the commands below to specify the host (server name or IP) and port for HTTP:
note: Here I used the IP address as the host, but that’s just one example IP.
The command below sets the port for the http proxy:
To check if the HTTP proxy was changed/updated successfully;
For “HTTPS” proxy
Hypertext Transfer Protocol over Secure Socket (HTTPS) is basically a request protocol between server and clients to provide secure transaction and communication for users. To determine the host for https Proxy, run the below mentioned command:
After that, determine the port for HTTPS using the command mentioned below:
Then check with below mentioned command:
For “FTP” proxy
The FTP proxy acts as a bridge/relay to transfer files between source and destination. Its performance is better than HTTP for larger files. To change the FTP proxy, run the commands below to discover both the host and the port on the Ubuntu system:
Then check by using the echo command mentioned below
For “sock” proxy
The SOCKS proxy facilitates communication between servers through the use of a firewall and supports the routing of any type of traffic generated by any program or protocol. Similar to all of the above that Socks proxy can also be changed with gsetting tool by using the below mentioned commands:
For example;
How do I change the system-wide proxy settings?
All of the above commands change the proxy setting for the current user, but if you want to imply the same proxy changes system-wide, run all of the commands as well sudo Have administrator rights to change the system proxy:
Just to quote that example; here I have only the “http” Proxy setting for the entire system. You can change your desired system-wide proxy settings by following the same commands mentioned in the previous section. However, remember, “sudo” with you:
How to switch proxy mode?
There are three proxy setting modes in Ubuntu system and they are:
1: “Auto” mode
Run the commands below to set the proxy mode to “automatic mode”, this is useful if you use PAC (Proxy Auto Config) at Ubuntu.
Switch to automatic mode with the following command:
2: “Manual” mode
Manual mode is used when you want to manually change each proxy setting, as we did in the first two sections of this article.
3: None
If you do not want proxy changes to be applied to your system, you can clear all proxy settings using the command mentioned below:
Diploma
To change the system proxy setting in Ubuntu from the command line, the gsetting tool is used. All proxy settings can be modified/changed with gsetting Tool. The commands and syntax for each proxy setting are explained in the guidelines above. The Proxy Modesautomobile“, “Manual” And “none‘ are also discussed above along with the commands for each mode.