Linux
关于如何在 Linux 上设置代理的说明。
如何在 Linux 上设置代理
Linux 为对另类操作系统感兴趣的人提供了多种发行版。遗憾的是,我们不可能涵盖所有发行版的设置。本指南将提供对全系统代理设置的良好理解。
- 首先,打开终端。
- 然后,以根用户身份登录。

Linux – 登录
- 接着,用
nano
打开/etc/environment
文件。

Linux – 打开文件
- 现在您将看到一个文本编辑器窗口。配置您的代理:
http_proxy="https:/ /gate.visitxiangtan.com:7000" https_proxy="https:/ /gate.visitxiangtan.com:7000" no_proxy="localhost"
您可以从可用列表中选择任何其他端点。如有需要,还可通过以下方式进行用户名:username: password
(密码验证 ) http://username:password@gate.visitxiangtan.com:7000.

Linux - 配置您的代理
- 要完成所选文件的编辑,请按 CTRL + X,然后输入 Y 保存更改,并按 ENTER 键确认文件位置。

Linux – 完成文件编辑
- 最后,锁定文件并重启机器。请注意,如果跳过这一步,代理更改可能会消失。
要锁定文件,输入 chattr +i /etc/environment
。要稍后解锁,可以使用 -i
标志。

Linux – 锁定文件
Updated 9 months ago