如何续订过期的Ubuntu OpenLDAP SSL证书

我们完成了撤销我们的OpenLDAP服务器使用的SSL证书并更新它的步骤,但我们无法启动slapd.

以下是我们使用的命令:

  openssl verify hostname_domain_com_cert.pem

我们回来证明证书已过期,但“确定”

我们撤销了我们一直使用的证书:

  openssl ca -revoke /etc/ssl/certs/hostname_domain_com_cert.pem

撤销工作正常.

我们通过将密钥文件作为输入传递来创建新的证书请求:

  openssl req -new -key hostname_domain_com_key.pem -out newreq.pem

我们使用新创建的请求文件“newreq.pem”生成了新证书

  openssl ca  -policy policy_anything -out newcert.pem -infiles newreq.pem

我们查看了我们的cn = config.ldif文件,找到了密钥和证书的位置,并将新日期的证书放在所需的路径中.

仍然我们无法启动slapd:

  service slapd start

我们收到此消息:

Starting OpenLDAP: slapd - Failed.
The operation Failed but no output was produced. For hints on what went
wrong please refer to the system's logfiles (e.g. /var/log/syslog) or
try running the daemon in Debug mode like via "slapd -d 16383" (warning:
this will create copIoUs output).

Below,you can find the command line options used by this script to
run slapd. Do not forget to specify those options if you
want to look to debugging output:
  slapd -h 'ldap:/// ldapi:/// ldaps:///' -g openldap -u openldap -F /etc/ldap/slapd.d/

这是我们在/ var / log / syslog中找到的内容

Oct 23 20:18:25 ldap1 slapd[2710]: @(#) $OpenLDAP: slapd 2.4.21 (Dec 19 2011 15:40:04) $#012#011buildd@allspice:/build/buildd/openldap-2.4.21/debian/build/servers/slapd
Oct 23 20:18:25 ldap1 slapd[2710]: main: TLS init def ctx Failed: -1
Oct 23 20:18:25 ldap1 slapd[2710]: slapd stopped.
Oct 23 20:18:25 ldap1 slapd[2710]: connections_destroy: nothing to destroy.

生成新的ldap1密钥/证书对之后,我们每当我们尝试启动slapd时都会得到它

Oct 24 08:38:12 ldap1 slapd[5461]: @(#) $OpenLDAP: slapd 2.4.21 (Dec 19 2011 15:40:04) $#012#011buildd@allspice:/build/buildd/openldap-2.4.21/debian/build/servers/slapd
Oct 24 08:38:12 ldap1 slapd[5463]: hdb_db_open: database "cn=accesslog" cannot be opened,err 13. Restore from backup!
Oct 24 08:38:12 ldap1 slapd[5463]: bdb(cn=accesslog): txn_checkpoint interface requires an environment configured for the transaction subsystem
Oct 24 08:38:12 ldap1 slapd[5463]: bdb_db_close: database "cn=accesslog": txn_checkpoint Failed: Invalid argument (22).
Oct 24 08:38:12 ldap1 slapd[5463]: backend_startup_one (type=hdb,suffix="cn=accesslog"): bi_db_open Failed! (13)
Oct 24 08:38:13 ldap1 slapd[5463]: bdb_db_close: database "cn=accesslog": alock_close Failed
Oct 24 08:38:13 ldap1 slapd[5463]: slapd stopped.

我们应该尝试从备份中恢复ldap吗?

这里有一些可能性.

新证书是否真的对颁发的CA证书有效且可验证?

在OpenLDAP配置中,属性olctlscacertificatefile的值是多少?在您的情况下,它应指向您的根CA证书,即签署服务器证书的证书.但是,正确的值是/etc/ssl/certs/ca-certificates.crt,其中包含所有可信CA证书的连接.有关详细信息,请参见此处:http://manpages.ubuntu.com/manpages/precise/man8/update-ca-certificates.8.html

它还可以指示权限问题. openldap用户可以读取密钥和证书(以及父路径)吗?密钥和证书的路径是否AppArmor不抱怨?检查/var/log/kern.log以获取指示slapd尝试读取AppArmor允许的路径之外的文件的消息.

编辑:根据您更新的问题,这似乎与原始问题无关,看起来您要么搞砸/ var / lib / ldap中的权限,要么您真的设法破坏/ var / lib /中的一个或多个文件LDAP.我说从备份恢复.

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...