Update files/ldap-ssh-key.sh

This commit is contained in:
William Mantly 2025-03-03 14:51:12 +00:00
parent 0bdd1a24ec
commit 59153cc0d3

View File

@ -1,3 +1,9 @@
#!/bin/bash
ldapsearch -H "ldap://{{ldap_host}}" -D "{{ldap_bind_dn}}" -w "{{ldap_bind_password}}" '(&(|(memberof=cn=host_access,ou=Groups,{{ldap_base_dn}})(memberof=cn=host_{{current_host}}_access,ou=Groups,{{ldap_base_dn}}))(uid='"$1"'))' 'sshPublicKey' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'
ldapsearch -H "ldap://10.1.0.55" \
-D "cn=ldapclient service,ou=People,dc=theta42,dc=com" \
-w "1lovebyte" \
-b "ou=People,dc=theta42,dc=com" \
"(&(uid=$1)(|(memberof=cn=host_access,ou=Groups,dc=theta42,dc=com)(memberof=cn=host_ldap-client-test_access,ou=Groups,dc=theta42,dc=com)))" \
'*' | sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'