> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/19/server-administration/runtime/gssapi-enc.md). Agents can also search and read this documentation through its [MCP server](https://docs.postgresql.tw/~gitbook/mcp).

# 18.10. 使用 GSSAPI 加密的安全 TCP/IP 連線 \#

### 18.10. 使用 GSSAPI 加密的安全 TCP/IP 連線 [#](#gssapi-enc) <a href="#gssapi-enc" id="gssapi-enc"></a>

[18.10.1. 基本設定](#gssapi-setup)

PostgreSQL 也原生支援使用 GSSAPI， 為用戶端與伺服器之間的通訊加密，以提升安全性。 此支援要求用戶端與伺服器系統上，都必須安裝 GSSAPI 實作（例如 MIT Kerberos）， 並且必須在建置時，啟用 PostgreSQL 中對此的支援 （請參閱[第 17 章](https://docs.postgresql.tw/19/server-administration/installation.md)）。

#### 18.10.1. 基本設定 [#](#gssapi-setup) <a href="#gssapi-setup" id="gssapi-setup"></a>

PostgreSQL 伺服器，會在同一個 TCP 連接埠上， 同時聆聽一般連線與 GSSAPI 加密連線， 並會與任何連線中的用戶端，協商是否要使用 GSSAPI 進行加密（以及驗證）。依預設，這項決定 由用戶端決定（這也意味著，攻擊者可能將其降級）； 關於如何設定伺服器，讓部分或所有連線， 都要求使用 GSSAPI，請參閱 [20.1 節](https://docs.postgresql.tw/19/server-administration/client-authentication/auth-pg-hba-conf.md)。

在使用 GSSAPI 進行加密時，通常也會一併使用 GSSAPI 進行驗證，因為底層機制，無論如何都會（依據 GSSAPI 實作） 決定用戶端與伺服器的身分。不過，這並非必要條件； 您也可以選擇另一種 PostgreSQL 驗證方式， 來執行額外的驗證。

除了協商行為的設定之外，GSSAPI 加密， 不需要任何超出 GSSAPI 驗證所需設定的額外設定。 （關於相關設定的更多資訊， 請參閱[20.6 節](https://docs.postgresql.tw/19/server-administration/client-authentication/gssapi-auth.md)。）

***

原文：[PostgreSQL 18.6 Documentation](https://www.postgresql.org/docs/18/gssapi-enc.html)（原文版本：18.6；核對日期：2026-09-22）


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/19/server-administration/runtime/gssapi-enc.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
