13.2. 目录用户
13.2.1. Red Hat Enterprise Virtualization 的目录服务支持
admin)会被创建。这个用户可以被用来对环境进行初始的设置以及进行故障排除。为了在 Red Hat Enterprise Virtualization 环境中创建其它用户,需要首先把一个目录服务器附加到 Manager 上。对于 Red Hat Enterprise Virtualization 3.5 以前的环境,使用域管理工具(engine-manage-domains)把一个目录服务器附加到 Manager上,相关信息,请参阅 Red Hat Enterprise Virtualization 管理指南 的 The Domain Management Tool 一节;对于 Red Hat Enterprise Virtualization 3.5 或更新的环境,使用新的通用 LDAP 供应商功能,相关信息,请参阅 Red Hat Enterprise Virtualization 管理指南 的 Configuring a Generic LDAP Provider 一节。
user@domain。另外,您也可以为 Red Hat Enterprise Virtualization Manager 附加多个目录服务器。
- Active Directory
- Identity Management (IdM)
- Red Hat Directory Server 9 (RHDS 9)
- OpenLDAP
- 目录服务器的反向查找地址的有效指针记录(PTR)。
- 使用 TCP 端口
389的 LDAP 的有效服务记录(SRV)。 - 使用 TCP 端口
88的 Kerberos 的有效服务记录(SRV)。 - 使用 UDP 端口
88的 Kerberos 的有效服务记录(SRV)。
engine-manage-domains 来把这个域添加到 Red Hat Enterprise Virtualization Manager 配置中。
- Active Directory - http://technet.microsoft.com/en-us/windowsserver/dd448614.
- Identity Management (IdM) - http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/6/html/Identity_Management_Guide/index.html
- Red Hat Directory Server (RHDS) - http://docs.redhat.com/docs/en-US/Red_Hat_Directory_Server/index.html
- OpenLDAP - http://www.openldap.org/doc/
重要
重要
重要
sysprep,您必须为 Red Hat Enterprise Virtualization 的管理员设置“委派对组织单位的控制(delegation of control)”来进行以下操作:
- 把一个计算机添加到域中
- 修改一个组的成员
注意
- 为 RHDS 配置
memberOf插件来允许使用组成员功能。您需要把memberOf插件的memberofgroupattr属性设置为uniqueMember。在 OpenLDAP 中,memberOf功能并不被称为“插件(plugin)”,它被称为 "overlay", 您在安装后不需要配置它。您可以参阅 Red Hat Directory Server 9.0 Plug-in Guide 来获得更多关于配置memberOf插件的信息。 - 在 Kerberos realm 中把目录服务器定义为服务(格式为
ldap/hostname@REALMNAME)。您需要使用目录服务器的全局域名(FQDN)替换 hostname,使用全局 Kerberos realm 名替换 REALMNAME。Kerberos realm 名必须是大写。 - 在 Kerberos realm 中为目录服务器产生一个
keytab文件。keytab文件包括了 Kerberos principal 以及和它们相关的加密密钥。这些密钥被目录服务器用来和 Kerberos realm 进行验证。请参阅 Kerberos principle 的相关文档来获得更多关于生成keytab文件的信息。 - 在目录服务器上安装
keytab文件,然后配置 RHDS 来识别keytab文件,并接受使用 GSSAPI 进行的 Kerberos 验证。请参阅 Red Hat Directory Server 9.0 Administration Guide 来获得更多关于配置 RHDS 来使用外部keytab文件的信息。 - 要测试您的目录服务器配置,您可以使用
kinit命令来验证在 Kerberos realm 中定义的用户。一旦验证成功后,您可以运行ldapsearch命令在目录服务器上进行查询。使用-Y GSSAPI参数来指定使用 Kerberos 进行验证。
13.2.2. 配置通用的 LDAP 供应商
注意
过程 13.1. 配置通用的 LDAP 供应商
- 在 Red Hat Enterprise Virtualization Manager 中安装 LDAP 扩展软件包:
# yum install ovirt-engine-extension-aaa-ldap
- 把 LDAP 配置模板文件复制到
/etc/ovirt-engine目录中。其中包括了 Active Directory(ad)和其它目录服务类型(simple)的模板文件。这个示例使用简单配置模板。# cp -r /usr/share/ovirt-engine-extension-aaa-ldap/examples/simple/. /etc/ovirt-engine
- 编辑 LDAP 属性配置文件,取消注释一个 LDAP 服务器类型并更新域和密码项的内容。
# vi /etc/ovirt-engine/aaa/profile1.properties
例 13.1. 配置档案实例:LDAP 服务器部分
# # Select one # include = <openldap.properties> #include = <389ds.properties> #include = <rhds.properties> #include = <ipa.properties> #include = <iplanet.properties> #include = <rfc2307.properties> # # Server # vars.server = ldap1.company.com # # Search user and its password. # vars.user = uid=search,cn=users,cn=accounts,dc=company,dc=com vars.password = 123456 pool.default.serverset.single.server = ${global:vars.server} pool.default.auth.simple.bindDN = ${global:vars.user} pool.default.auth.simple.password = ${global:vars.password}为了使用 TLS 或 SSL 协议来与 LDAP 服务器进行交流,获得 LDAP 服务器的根(root)CA 证书,使用它来创建一个公共的 keystore 文件。取消注释以下行,指定到公共 keystore 文件的完全路径以及访问这个文件的密码。注意
如需了解更多与创建公共 keystore 文件相关的信息,请参阅 第 C.2 节 “在 Manager 和一个 LDAP 服务器间设置 SSL 或 TLS 连接”。例 13.2. 配置档案实例:keystore 部分
# Create keystore, import certificate chain and uncomment # if using tls. pool.default.ssl.startTLS = true pool.default.ssl.truststore.file = /full/path/to/myrootca.jks pool.default.ssl.truststore.password = changeit
- 检查验证配置文件。profile 名在管理门户和用户门户的登录界面中可见。配置 profile 的位置必须和 LDAP 配置文件的位置相匹配。所有项都可以使用默认值。
# vi /etc/ovirt-engine/extensions.d/profile1-authn.properties
例 13.3. 验证配置文件的示例
ovirt.engine.extension.name = profile1-authn ovirt.engine.extension.bindings.method = jbossmodule ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.aaa.ldap ovirt.engine.extension.binding.jbossmodule.class = org.ovirt.engineextensions.aaa.ldap.AuthnExtension ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.aaa.Authn ovirt.engine.aaa.authn.profile.name = profile1 ovirt.engine.aaa.authn.authz.plugin = profile1-authz config.profile.file.1 = ../aaa/profile1.properties
- 检查授权配置文件。这个配置集的配置必须和 LDAP 配置文件的位置相匹配。所有项都可以使用默认值。
# vi /etc/ovirt-engine/extensions.d/profile1-authz.properties
例 13.4. 授权配置文件的示例
ovirt.engine.extension.name = profile1-authz ovirt.engine.extension.bindings.method = jbossmodule ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.aaa.ldap ovirt.engine.extension.binding.jbossmodule.class = org.ovirt.engineextensions.aaa.ldap.AuthzExtension ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.aaa.Authz config.profile.file.1 = ../aaa/profile1.properties
- 为配置文件设置正确的所有者权限和访问权限:
# chown ovirt:ovirt /etc/ovirt-engine/aaa/profile1.properties
# chmod 600 /etc/ovirt-engine/aaa/profile1.properties
- 重新启动引擎服务。
# service ovirt-engine restart
- 在管理门户和用户门户的登录页中包括了刚创建的 ldap1 profile。如需了解更多与为 LDAP 服务器中的用户分配相关权限(如登录到用户门户的权限)的信息,请参阅 Red Hat Enterprise Virtualization Administration Guide 的 Red Hat Enterprise Virtualization Manager User Tasks 一节。
注意
/usr/share/doc/ovirt-engine-extension-aaa-ldap-version)。
13.2.3. 管理门户和用户门户的单点登录
注意
13.2.3.1. 为 LDAP 和 Kerberos 配置单点登录
- 存在的 KDC(Key Distribution Center,密钥分配中心)服务器使用 MIT 版的 Kerberos 5。
- 您具有 KDC 服务器的管理权限。
- Red Hat Enterprise Virtualization Manager 和用户的机器上安装了 Kerberos 客户端。
kadmin工具程序可以被用来创建 Kerberos 服务主体(principal)和keytab文件。
在 KDC 服务器上
- 为 Red Hat Enterprise Virtualization Manager 上的 Apache 服务创建一个服务主体(principal)和一个
keytab文件。
在 Red Hat Enterprise Virtualization Manager 上
- 安装 Manager 的验证和授权扩展软件包,以及 Apache Kerberos 验证模块。
- 配置扩展文件。
过程 13.2. 为 Apache 服务配置 Kerberos
- 在 KDC 服务器上,使用
kadmin为 Red Hat Enterprise Virtualization Manager 上的 Apache 服务创建一个服务主体。这个服务主体是 KDC 指代 Apache 服务的 ID。# kadmin kadmin> addprinc -randkey HTTP/fqdn-of-rhevm@REALM.COM
- 为 Apache 服务产生一个
keytab文件。keytab文件保存了共享的密钥。kadmin> ktadd -k /tmp/http.keytab HTTP/fqdn-of-rhevm@REALM.COM
kadmin> quit
- 把
keytab文件从 KDC 服务器复制到 Red Hat Enterprise Virtualization Manager:# scp /tmp/http.keytab root@rhevm.example.com:/etc/httpd
过程 13.3. 配置到用户门户和管理门户的单点登录
- 在 Red Hat Enterprise Virtualization Manager 上,设置正确的 keytab 所有者权限和访问权限:
# chown apache /etc/httpd/http.keytab
# chmod 400 /etc/httpd/http.keytab
- 安装验证扩展软件包、LDAP 扩展软件包和
mod_auth_kerb验证模块:# yum install ovirt-engine-extension-aaa-misc ovirt-engine-extension-aaa-ldap mod_auth_kerb
- 把 SSO 配置模板文件复制到
/etc/ovirt-engine目录中。其中包括了 Active Directory(ad-sso)和其它目录服务类型(simple-sso)的模板文件。这个示例使用简单 SSO 配置模板# cp -r /usr/share/ovirt-engine-extension-aaa-ldap/examples/simple-sso/. /etc/ovirt-engine
- 为 Apache 创建一个
/etc/httpd/conf.d目录的软链接来使用 SSO 配置文件:# ln -s /etc/ovirt-engine/aaa/ovirt-sso.conf /etc/httpd/conf.d
- 编辑验证方法文件来使 Apache 使用 Kerberos 进行验证:
# vi /etc/ovirt-engine/aaa/ovirt-sso.conf
例 13.5. 验证方法文件的示例
<LocationMatch ^(/ovirt-engine/(webadmin|userportal|api)|/api)> RewriteEngine on RewriteCond %{LA-U:REMOTE_USER} ^(.*)$ RewriteRule ^(.*)$ - [L,P,E=REMOTE_USER:%1] RequestHeader set X-Remote-User %{REMOTE_USER}s AuthType Kerberos AuthName "Kerberos Login" Krb5Keytab /etc/httpd/http.keytab KrbAuthRealms REALM.COM Require valid-user </LocationMatch> - 编辑 LDAP 属性配置文件,取消注释一个 LDAP 服务器类型并更新域和密码项的内容:
# vi /etc/ovirt-engine/aaa/profile1.properties
例 13.6. 配置档案实例:LDAP 服务器部分
# # Select one # include = <openldap.properties> #include = <389ds.properties> #include = <rhds.properties> #include = <ipa.properties> #include = <iplanet.properties> #include = <rfc2307.properties> # # Server # vars.server = ldap1.company.com # # Search user and its password. # vars.user = uid=search,cn=users,cn=accounts,dc=company,dc=com vars.password = 123456 pool.default.serverset.single.server = ${global:vars.server} pool.default.auth.simple.bindDN = ${global:vars.user} pool.default.auth.simple.password = ${global:vars.password}为了使用 TLS 或 SSL 协议来与 LDAP 服务器进行交流,获得 LDAP 服务器的根(root)CA 证书,使用它来创建一个公共的 keystore 文件。取消注释以下行,指定到公共 keystore 文件的完全路径以及访问这个文件的密码。注意
如需了解更多与创建公共 keystore 文件相关的信息,请参阅 第 C.2 节 “在 Manager 和一个 LDAP 服务器间设置 SSL 或 TLS 连接”。例 13.7. 配置档案实例:keystore 部分
# Create keystore, import certificate chain and uncomment # if using ssl/tls. pool.default.ssl.startTLS = true pool.default.ssl.truststore.file = /full/path/to/myrootca.jks pool.default.ssl.truststore.password = changeit
- 检查验证配置文件。profile 名在管理门户和用户门户的登录界面中可见。配置 profile 的位置必须和 LDAP 配置文件的位置相匹配。所有项都可以使用默认值。
# vi /etc/ovirt-engine/extensions.d/profile1-http-authn.properties
例 13.8. 验证配置文件的示例
ovirt.engine.extension.name = profile1-authn ovirt.engine.extension.bindings.method = jbossmodule ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.aaa.ldap ovirt.engine.extension.binding.jbossmodule.class = org.ovirt.engineextensions.aaa.ldap.AuthnExtension ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.aaa.Authn ovirt.engine.aaa.authn.profile.name = profile1-http ovirt.engine.aaa.authn.authz.plugin = profile1-authz ovirt.engine.aaa.authn.mapping.plugin = http-mapping config.artifact.name = HEADER config.artifact.arg = X-Remote-User
- 检查授权配置文件。这个配置集的配置必须和 LDAP 配置文件的位置相匹配。所有项都可以使用默认值。
# vi /etc/ovirt-engine/extensions.d/profile1-authz.properties
例 13.9. 授权配置文件的示例
ovirt.engine.extension.name = profile1-authz ovirt.engine.extension.bindings.method = jbossmodule ovirt.engine.extension.binding.jbossmodule.module = org.ovirt.engine-extensions.aaa.ldap ovirt.engine.extension.binding.jbossmodule.class = org.ovirt.engineextensions.aaa.ldap.AuthzExtension ovirt.engine.extension.provides = org.ovirt.engine.api.extensions.aaa.Authz config.profile.file.1 = ../aaa/profile1.properties
- 为配置文件设置正确的所有者权限和访问权限:
# chown ovirt:ovirt /etc/ovirt-engine/aaa/profile1.properties
# chmod 600 /etc/ovirt-engine/aaa/profile1.properties
- 重启 Apache 服务和引擎服务:
# service httpd restart
# service ovirt-engine restart

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.