「LDAP」タグアーカイブ

OpenLDAP checksum error

久しぶりにArch Linuxの話題です。LDAP認証も軌道に乗ってきまして、今度は止まっては困る状況になりました。そこで、今更ながらLDAPのバックアップを取るように検討したところ、slapcatでエラーが出ます。

[bash]
ldif_read_file: checksum error on “/etc/openldap/slapd.d/cn=config.ldif”
[/bash]
続きを読む OpenLDAP checksum error

Arch LinuxでAuthorizedKeysCommandにLDAPに登録されている公開鍵を回答するスクリプトを設定する

LDAPで鍵認証させてSSHにログインする場合、CentOSなんかだと、AuthorizedKeysCommandにssh-ldap-wrapperを指定するのですが、Arch Linuxにこれが見当たらなかったので、下記のページを参考にして、独自のスクリプトを設定しました。

OpenSSH 6.2.x and LDAP authentication

my OpenSSH AuthorizedKeysCommand script

[bash]
#!/bin/bash

LDAP_SERVER=”ldap://localhost”
BASE_DN=”ou=People,dc=example,dc=com”
BIND_DN=”cn=Manager,dc=example,dc=com”
BIND_PW=”パスワード”

SSH_USER=$1

KEY=$(ldapsearch -LLL -x -w ${BIND_PW} -o ldif-wrap=no -D “${BIND_DN}” -b “${BASE_DN}” -H “${LDAP_SERVER}” -S sshPublicKey “uid=${SSH_USER}” sshPublicKey | grep -v ‘dn:’ | perl -pe ‘s/sshPublicKey: //;’)

echo “${KEY}”
[/bash]

後はこのスクリプトを保存して、
/etc/ssh/sshd_config

AuthorizedKeysCommand [スクリプトへのパス]
を指定してやればOKです。