人大金仓CKP03-客户端认证参数

本文档详细解释了PostgreSQL的两个关键配置文件,sys_hba.conf用于控制客户端连接权限、认证方式和数据库访问,而sys_ident.conf则处理用户名映射。文章介绍了不同类型的连接、认证方法以及如何设置安全选项,如使用加密密码进行验证。
摘要由CSDN通过智能技术生成

sys_hba.conf

验证顺序:从上往下

TYPE DATABASE USER ADDRESS METHOD

本地:local 127.0.0.1/32

METHOD :“scram-sha-256” are preferred since they send encrypted passwords.

在这里插入图片描述

https://www.postgresql.org/docs/current/auth-methods.html

# Kingbase Client Authentication Configuration File
# ===================================================
#
# Refer to the "Client Authentication" section in the Kingbase
# documentation for a complete description of this file.  A short
# synopsis follows.
#
# This file controls: which hosts are allowed to connect, how clients
# are authenticated, which Kingbase user names they can use, which
# databases they can access.  Records take one of these forms:
#
# local      DATABASE  USER  METHOD  [OPTIONS]
# host       DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostssl    DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
# hostnossl  DATABASE  USER  ADDRESS  METHOD  [OPTIONS]
#
# (The uppercase items must be replaced by actual values.)
#
# The first field is the connection type: "local" is a Unix-domain
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
# plain TCP/IP socket.
#
# DATABASE can be "all", "sameuser", "samerole", "replication", a
# database name, or a comma-separated list thereof. The "all"
# keyword does not match "replication". Access to replication
# must be enabled in a separate record (see example below).
#
# USER can be "all", a user name, a group name prefixed with "+", or a
# comma-separated list thereof.  In both the DATABASE and USER fields
# you can also write a file name prefixed with "@" to include names
# from a separate file.
#
# ADDRESS specifies the set of hosts the record matches.  It can be a
# host name, or it is made up of an IP address and a CIDR mask that is
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
# specifies the number of significant bits in the mask.  A host name
# that starts with a dot (.) matches a suffix of the actual host name.
# Alternatively, you can write an IP address and netmask in separate
# columns to specify the set of hosts.  Instead of a CIDR-address, you
# can write "samehost" to match any of the server's own IP addresses,
# or "samenet" to match any address in any subnet that the server is
# directly connected to.
#
# METHOD can be "trust", "reject", "md5", "password", "sha-256",
# "gss", "sspi", "ident", "peer", "pam", "ldap", "radius" or "cert".
# Note that "password" sends passwords in clear text; "md5" or
# "sha-256" are preferred since it sends encrypted passwords.
#
# OPTIONS are a set of options for the authentication in the format
# NAME=VALUE.  The available options depend on the different
# authentication methods -- refer to the "Client Authentication"
# section in the documentation for a list of which options are
# available for which authentication methods.
#
# Database and user names containing spaces, commas, quotes and other
# special characters must be quoted.  Quoting one of the keywords
# "all", "sameuser", "samerole" or "replication" makes the name lose
# its special character, and just match a database or username with
# that name.
#
# This file is read on server startup and when the kingbase receives
# a SIGHUP signal.  If you edit the file on a running system, you have
# to SIGHUP the kingbase for the changes to take effect.  You can
# use "sys_ctl reload" to do that.

# Put your actual configuration here
# ----------------------------------
#
# If you want to allow non-local connections, you need to add more
# "host" records.  In that case you will also need to make Kingbase
# listen on a non-local interface via the listen_addresses
# configuration parameter, or via the -i or -h command line switches.



# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             all                                     md5
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             0.0.0.0/0               md5
# IPv6 local connections:
host    all             all             ::1/128                 md5
host    all             all             ::0/0                   md5
# Allow replication connections from localhost, by a user with the
# replication privilege.
#local   replication     kingbase                                md5
#host    replication     kingbase        127.0.0.1/32            md5
#host    replication     kingbase        ::1/128                 md5

sys_ident.conf

local – 只能

# Kingbase User Name Maps
# =========================
#
# Refer to the Kingbase documentation, chapter "Client
# Authentication" for a complete description.  A short synopsis
# follows.
#
# This file controls Kingbase user name mapping.  It maps external
# user names to their corresponding Kingbase user names.  Records
# are of the form:
#
# MAPNAME  SYSTEM-USERNAME  KDB-USERNAME
#
# (The uppercase quantities must be replaced by actual values.)
#
# MAPNAME is the (otherwise freely chosen) map name that was used in
# sys_hba.conf.  SYSTEM-USERNAME is the detected user name of the
# client.  KDB-USERNAME is the requested Kingbase user name.  The
# existence of a record specifies that SYSTEM-USERNAME may connect as
# KDB-USERNAME.
#
# If SYSTEM-USERNAME starts with a slash (/), it will be treated as a
# regular expression.  Optionally this can contain a capture (a
# parenthesized subexpression).  The substring matching the capture
# will be substituted for \1 (backslash-one) if present in
# KDB-USERNAME.
#
# Multiple maps may be specified in this file and used by sys_hba.conf.
#
# No map names are defined in the default configuration.  If all
# system user names and Kingbase user names are the same, you don't
# need anything in this file.
#
# This file is read on server startup and when the kingbase receives
# a SIGHUP signal.  If you edit the file on a running system, you have
# to SIGHUP the kingbase for the changes to take effect.  You can
# use "sys_ctl reload" to do that.

# Put your actual configuration here
# ----------------------------------

# MAPNAME       SYSTEM-USERNAME         KDB-USERNAME

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值