IBM Cloud Docs
设置 LDAP 认证

设置 LDAP 认证

使用 REGISTER EXTERNAL AUTHENTICATION SYSTEM SQL 语句 将认证方法设置为 LDAP

外部认证系统不支持双因子认证。

语法

REGISTER EXTERNAL AUTHENTICATION SYSTEM 'LDAP' with BASE SERVER
[ VERSION ]
[ BINDDN { bind-string | NONE } ]
[ BINDPW { bind-password | NONE } ]
[ PORT ]
[ SCOPE { SUB | ONE | BASE } ]
[ SSL { ON | OFF } ]
[ ATTRNAME ]
[ NAMECASE { LOWERCASE | UPPERCASE }]

其中:

LDAP的注册外部认证系统命令配置。
Input 描述
版本 要使用的 LDAP 协议版本号。 缺省值为 3。
绑定 DN 绑定到 LDAP 服务器时要使用的专有名称。 绑定字符串是可选的。 通常未定义此子句以执行匿名 LDAP 查找。
绑定 DPW 伴随 BINDDN 以绑定到 LDAP 服务器的密码。
PORT 连接到 LDAP 服务器时要使用的端口号。 缺省值为 389。
范围 搜索 LDAP 树时要使用的作用域。
SSL 缺省值为 OFF。 如果 ON,那么在与 LDAP 服务器联系时将使用 SSL。 当您指定 LDAP 作为认证类型时,必须指定 SSL 选项。
属性名 LDAP 服务器中定义的包含用户名的字段。 对于微软的 "Active Directory,通常是 "'sAMAccountname',,对于 "IBM®""Tivoli Directory Server"是 "uid",对于 "OpenLDAP服务器是 "cn"。 缺省值为 "cn"。
适合的情况 指示 LDAP 服务器是将用户名存储为小写还是大写。

使用 Web 控制台设置 LDAP 认证

  1. 登录到 Web 控制台 作为 admin

  2. 转至 查询编辑器

  3. 注册 LDAP 外部认证系统。 指定必需的参数。

    REGISTER EXTERNAL AUTHENTICATION SYSTEM 'LDAP' with base 'DC=cpsdevelopment,dc=fyre,dc=ibm,dc=com' namecase lowercase server 'windowsad-security1.fyre.ibm.com' ssl 'off' binddn 'CN=mannu,CN=Users,DC=cpsdevelopment,DC=fyre,DC=ibm,DC=com' bindpw 'Netezza@1234' attrname 'sAMAccountName';
    
  4. 创建用户 中创建外部认证方法设置为 LDAP 的用户。

  5. 验证是否已成功创建用户。

    1. 进入 “用户和组”>“用户”。
    2. 找到用户。
    3. 检查用户的 认证类型 部分。

使用命令行设置 LDAP 认证

  1. 连接到 NPSaaS 作为 admin

    在此示例中,将使用 "nzsql" 命令。 您还可以使用 ODBC 或 JDBC 驱动程序

    nzsql -host <nps_host_ip> -u admin -pw XXXXX
    
    示例
    Input 描述
    nps_host_ip

    指定实例的 IP 地址。
    要检索 NPS HOST IP:
    1。 登录您的 IBM Cloud 账户。

    1. 转至 专用端点> 服务实例详细信息
      1。 选择实例。
      现在,您的实例 IP 地址将显示在页面上。
    用户 指定用户名。
    密码 指定用户的密码。

    示例:

    nzsql -host X.XX.XXX.XXX -u admin -pw password
    Welcome to nzsql, the IBM Netezza SQL interactive terminal.
    Type:  \h for help with SQL commands
           \? for help on internal slash commands
           \g or terminate with semicolon to execute query
           \q to quit
    
    SYSTEM.ADMIN(ADMIN)=>
    
  2. 注册 LDAP 外部认证系统。 指定必需的参数。

    REGISTER EXTERNAL AUTHENTICATION SYSTEM 'LDAP' with base 'DC=cpsdevelopment,dc=fyre,dc=ibm,dc=com' namecase lowercase server 'windowsad-security1.fyre.ibm.com' ssl 'off' binddn 'CN=mannu,CN=Users,DC=cpsdevelopment,DC=fyre,DC=ibm,DC=com' bindpw 'Netezza@1234' attrname 'sAMAccountName';
    
  3. 创建一个或多个外部认证方法设置为 LDAP 的用户。

    CREATE USER "USER" with auth external 'LDAP';
    
  4. 验证是否已成功创建用户。

    \q
    
    nzsql -d SYSTEM NAME -u '"USER"' -pw PASSWORD
    

    示例:

    \q
    
    nzsql -d system -u '"user1"' -pw XXXXXXXXXXXXXX
    Welcome to nzsql, the IBM Netezza SQL interactive terminal.
    
    Type: \h for help with SQL commands
    ? for help on internal slash commands
    \g or terminate with semicolon to execute query
    \q to quit
    
    SSL enabled connection. Cipher: ECDHE-RSA-AES256-GCM-SHA384, bits: 256, protocol: TLSv1.2
    
    SYSTEM.ADMIN(user1)=>