How to set up a global proxy server in Ubuntu
Hello there, dear readers! Today I'm going to show you how to set up a global proxy server in Ubuntu OS. I believe this is a relatively common need for many of you who use Ubuntu. Sometimes, we may need to surf the Internet or strengthen network security, and this can be easily achieved by setting up a global proxy server. So, I will provide you with a detailed description of the specific steps, please be patient to look down Oh!
Step 1: Open a terminal
First, we need to open a terminal window. In Ubuntu, the terminal is a powerful tool for all kinds of operations, and it is as smart as the brain of a computer. You just need to press "Ctrl+Alt+T" and the terminal window will appear in front of you. Wow, isn't it a bit amazing?
Step 2: Edit the environment variable configuration file
Now, we need to edit Ubuntu's environment variable configuration file to let the system know that we want to use a global proxy server. Please open this configuration file by typing the following command in the terminal:
"`shell
sudo gedit /etc/environment
“`
The "sudo" command here is to run the editor with administrator privileges so that we can change the contents of the file. This command tells the system, "Hey buddy, open the file /etc/environment for me!"
Well, I guess you may ask: "What is sudo?" I'm sorry, but this command is like a key that can help us open some doors with restricted privileges. How about it, isn't it a bit exciting like opening a treasure chest?
Step 3: Configure proxy server information
Once you open the environment variables configuration file, you will see a blank page. I'm here to show you some magic to make the proxy server information appear later on this page. Enter the following at the end of the page:
Aha, I have italicized some of the letters, they need to be replaced! The address and port of the proxy server are based on the actual situation you are using. Remember to replace "your_proxy_server" with the real address of the proxy server! The port is a specific entry point on the server, so make sure you fill it in correctly! It's amazing how the Great Wizard can make our computers communicate with servers all over the world! Read on!
Step 4: Save the configuration file and exit the editor
After the configuration is finished, please click the "Save" button in the upper right corner of the editor window to save the fruits of your labor. Haha, the editor is just like a little secretary to help you save the configuration file! Then, close the editor window, you can proceed to the next step.
Step 5: Apply the new environment variable configuration
For the configuration to take effect, we need to run the following command through the terminal again:
"`shell
source /etc/environment
“`
This command tells the system, "Hey, hey, hey, hey, old iron, there's an updated environment variable configuration now, come and apply it for me!" The system will immediately take your request and refresh the environment variable configuration. Seeing this command above, doesn't it feel like you become a super commander who can change the behavior of your computer at any time?
Step 6: Verify that the global proxy server settings are successful
As a final step, we need to verify that our labor has yielded the desired results. Huh, a dialog box pops up, what's going on? Don't be nervous, this is just a system set up to protect our security, you just need to enter the password of the administrator account. Then, I want to teach you a "tip", please run the following command in the terminal to verify the success of the proxy server settings:
"`shell
echo $http_proxy
“`
If the result returned is the proxy server address and port you just configured, congratulations! The setup is successful! No, I was too excited, even memorized it, I forgot to tell you that the output results are presented in the terminal above Oh! Oops, I'm so stupid, I'll think about it later.
Well, that's it for today's tutorial! I hope that through this article, you can easily master the method of setting up a global proxy server in Ubuntu. There is one more thing to remind you: the use of proxy servers to comply with local laws and regulations, do not use for illegal purposes!Finally, I'm going to say bye-bye to you all! Well, stupid bye, uh, no, it's goodbye, haha~ If you have any questions, please feel free to come and play with me!