我使用LDAP进行ssh autorithation。
userPassword {crypt}正常工作,但{md5}无效。
ldapmodify -Vv -D "cn=Manager,dc=*,dc=*" -W -f *.ldif
* LDIF:
dn: uid=*,ou=People,dc=*,dc=*
changetype: modify
replace: userPassword
userPassword: {CRYPT}eGUw6pD1aAClQ
* LDIF:
dn: uid=*,ou=People,dc=*,dc=*
changetype: modify
replace: userPassword
userPassword: {MD5}ICy5YqxZB1uWSwcVLSNLcA==
标准配置: https://wiki.gentoo.org/wiki/Centralized_authentication_using_OpenLDAP
答案 0 :(得分:0)
使用ssha解决:
slappasswd -h {ssha} -c 'some_salt'.
它比普通的md5更好。
结果:
ssha512
slappasswd -h {ssha} -c '$6$%s' -s 123
{CRYPT} $ 6 $ $ s2mWoK1ZzwO0v02J yi19QVOQB0ESrHwnCV.bl0RjwmwxWlNMl9z9FB0AqC9fL8SX2Q8Q2 / k0Zj.l0qNtOacq6SWMdmfkDWQ4L1cqp。
dn: uid=test1,ou=People,dc=*,dc=*
uid: test1
cn: test1
sn: test1
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {CRYPT}$6$s2mWoK1ZzwO0v02J$yi19QVOQB0ESrHwnCV.bl0RjwmwxWlNMl9z9FB0AqC9fL8SX2Q8Q2/k0Zj.l0qNtOacq6SWMdmfkDWQ4L1cqp.
shadowLastChange: 16176
loginShell: /bin/bash
uidNumber: 0
gidNumber: 0
homeDirectory: /home/test1
gecos: test1