# Ubuntu

[**Ubuntu**](https://ubuntu.com/) 是基于 Linux 的开源软件操作系统，适用于企业服务器、桌面、云和 IoT。

在 Ubuntu 上设置代理服务器有多种方式。在本指南中，你会找到两种常见方法： [使用系统（GNOME）设置](#method-1-system-settings) 并 [使用终端](#method-2-terminal-sessions).

### 方法 1：系统设置

要设置系统范围的网络代理，请按照以下步骤操作：

**步骤 1。** [**下载**](https://ubuntu.com/download/desktop) 并安装 Ubuntu 桌面版。

**步骤 2。** 找到 **设置** 从 Ubuntu 启动器中，并进入 **网络** 选项卡。

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiwDdoZGfMbUe5cRL2417%2Fuploads%2FbDYJnF1S6PKLhmBg1kU5%2Fimage.png?alt=media&#x26;token=aa0a5b5a-f669-4b8d-975e-2375995248ee" alt="Ubuntu launcher"><figcaption></figcaption></figure>

**步骤 3。** 一旦你点击 **网络**，它会打开一个新的对话框。在这三个选项中，选择 **网络代理。**

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiwDdoZGfMbUe5cRL2417%2Fuploads%2F0QpbIwlPPRIdIB3jYFza%2Fimage.png?alt=media&#x26;token=e78a2185-2744-409b-9ae8-5f0307963093" alt="Choose Network Proxy"><figcaption></figcaption></figure>

**步骤 4。** 选择 **手动** 来配置代理设置。接下来，会弹出几个文本框，你可以在其中设置 `HTTP` 或 `SOCKS` 代理。填写以下信息：&#x20;

**HTTP 代理：** 一个特定的 IP 地址（`192.168.1.100` - 示例）

{% hint style="info" %}
如果是独享数据中心代理，您需要从已购买的列表中选择一个 IP 地址。请参阅我们的 [**`文档`**](broken://pages/d5bbd36d0bb27800c335757921a3776e5c9d1459) 以了解更多详情。
{% endhint %}

**端口：** `60000`

<figure><img src="https://files.gitbook.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FiwDdoZGfMbUe5cRL2417%2Fuploads%2Fj415y9XFS32RYS9BaV9H%2Fimage.png?alt=media&#x26;token=7d2e8572-e17e-484a-87ba-4d1022b7ad76" alt="Configuring proxy" width="563"><figcaption></figcaption></figure>

**步骤 5。** 关闭网络代理窗口。更改将自动保存，系统范围的代理将被激活。&#x20;

每次你通过浏览器或其他应用程序发起网络请求时， **弹出窗口都会提示你输入该会话的凭据** ，即你的 Oxylabs 代理用户凭据。

***

### 方法 2：终端会话

要为所有终端会话设置网络代理，请按照以下步骤操作：

**步骤 1。** [**下载**](https://ubuntu.com/download/desktop) 并安装 Ubuntu 桌面版。

**步骤 2。** 打开 **shell** 配置，使用编辑器。

对于 ZSH 终端，shell 配置文件默认位于主目录中。我们可以使用 `vim` 通过以下命令编辑此文件：

```sh
vim ~/.zshrc
```

而不是 `vim`，你也可以使用 `gedit`, `nano`，或任何你喜欢的其他文本编辑器。另外，如果你使用的是 Bash 而不是 ZSH，你就必须编辑 bash shell 配置文件，即 `~/.bashrc` 而不是 `~/.zshrc`.

**步骤 3。** 创建两个新的环境变量

在这个配置文件的底部，你需要定义 `http_proxy` 或 `ALL_PROXY` （用于 SOCKS5）变量。你需要从代理列表中使用一个特定的 IP 地址。为了演示，我们使用 `192.168.1.100:60000`:

```sh
export http_proxy="USERNAME:PASSWORD@192.168.1.100:60000"
export ALL_PROXY="socks5://USERNAME:PASSWORD@192.168.1.100:60000"
```

你需要填写以下信息：

**代理地址：** 一个特定的 IP 地址（`192.168.1.100` - 示例）

**端口：** `60000`

**用户名：** `用户名`

**密码：** `密码`

**步骤 4。** 重新加载配置

现在，你可以通过打开一个新的终端，或者在当前终端中运行以下命令来重新加载配置文件：

```sh
source ~/.zshrc
```

代理将始终对当前用户处于激活状态。每次你打开一个新的终端时，shell 配置文件都会被加载。因此，即使你重启电脑，环境变量也会始终可用。

如果你想为所有用户启用它，那么你需要将上面两行追加到 `/etc/environment`.

就这样！你已经成功集成了你的 Oxylabs 代理。&#x20;

你可以找到完整教程 [这里](https://oxylabs.io/resources/integrations/ubuntu).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.oxylabs.io/integrations/cn/proxy-integrations/dedicated-datacenter-proxies-guides/enterprise/ubuntu-gui.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
