- 合并证书
freeipa要求必须要有完整的证书链,完整的证书链包含 域名证书、域名的中间证书、域名证书的密钥、根证书
一般的证书提供商所提供的证书下载方式,应选apache证书下载,因为nginx把中间证书,以及域名证书混合在一起。导致freeipa提示The full certificate chain is not present in 证书链不完整。
通常web 服务证书中是不包含根证书,所以根证书需要额外下载。
abc.com.crt 代表 域名证书
root_bundle.crt 代表 域名中间证书
abc.com.key 代表 域名证书密钥
root.crt 表示 根证书
cd /tmp/abc.com_apache
cat abc.com.crt \
root_bundle.crt \
abc.com.key \
root.crt > /etc/ssl/certs/abc.com
2、安装freeipa
在centos8 中freeipa 安装包不包含在标准仓库里,需要额外开启。
dnf module enable idm:DL1
dnf distro-sync
dnf install ipa-server ipa-server-dns -y
3、配置freeipa
ipa-server-install --idstart=11000000 --idmax=20000000 --realm=ABC.COM --domain=abc.com --ds-password=1qaz2wsx --admin-password=1qaz2wsx --hostname="freeipa-1.abc.com" --mkhomedir --dirsrv-cert-file=/etc/ssl/certs/abc.com/abc.com --http-cert-file=/etc/ssl/certs/abc.com/abc.com --no-pkinit
剩下根据提示,一路回车即可。
参数说明:
idstart 表示freeipa中的用户ID是从11000000开始 (避免与linux系统用户ID冲突)
idmax 表示freeipa中的用户ID最多可以有20000000个 (这里注意,用户ID不会复用,所以尽量搞多一些避免后续麻烦)
realm 表示 指定kerberos 后缀域
domain 表示域名
ds-password 是 ldap dn密码
admin-password 是 freeipa admin 登陆密码
hostname 是 安装freeipa主机名
mkhomedir 是 告诉客户,每次新用户登陆都需要创建home目录(默认是不创建用户home目录)
dirsrv-cert-file ldap证书位置
http-cert-file freeipa web证书位置
--no-pkinit 表示不配置pkinit 证书,目前我们还没有服务使用kerberos所以没有配置证书。
That wiki page explains its use. We utilize anonymous PKINIT internally
for Web UI password-based logins, aside from any other use that you
might have for normal PKINIT.
In general, PKINIT is a way to use smartcard (public key) authentication
with Kerberos, where actual authentication is done before Kerberos KDC
authenticates you (hence, it is a pre-authentication method in
Kerberos). A client uses own certificate to mutually authenticate KDC
pretty much like SSL/TLS authentication with client certificates
happens. The result of the mutual authentication is then used to create
a session key for Kerberos ticket granting ticket.
Anonymous PKINIT is a special case where a client identity does not need
to be proved. This corresponds to normal SSL/TLS use for HTTPS
connections where your browser does not need to present own certificate
but validates the server certificate. KDC then issues a ticket granting
ticket for a special Kerberos principal that can only be used
(realistically) to create a FAST channel wrapping. As result, one can
use anonymous PKINIT ticket to encrypt an exchange to authenticate with
2FA in Kerberos.
参考:https://www.howtoforge.com/tutorial/install-and-configure-freeipa-server-on-centos-8/
https://www.freeipa.org/page/V4/Kerberos_PKINIT
https://web.mit.edu/kerberos/krb5-1.12/doc/admin/pkinit.html
https://lists.fedorahosted.org/archives/list/freeipa-users@lists.fedorahosted.org/thread/NR2R4DRTRX45SAZ7KI37WZVNHWIW4GF5/