Postgresql 中文操作指南
21.9. Peer Authentication #
对等身份验证方法通过从内核获取客户端的操作系统用户名并将其用作允许的数据库用户名(可选择用户名映射)来运行。此方法仅支持本地连接。
The peer authentication method works by obtaining the client’s operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.
peer 支持以下配置选项:
The following configuration options are supported for peer:
-
map
-
Allows for mapping between system and database user names. See Section 21.2 for details.
-
对等身份验证仅在提供 getpeereid() 函数、SO_PEERCRED 套接字参数或类似机制的操作系统上可用。目前包括 Linux、大多数版本的 BSD(包括 macOS)和 Solaris。
Peer authentication is only available on operating systems providing the getpeereid() function, the SO_PEERCRED socket parameter, or similar mechanisms. Currently that includes Linux, most flavors of BSD including macOS, and Solaris.