Update files/ldap-ssh-key.sh

This commit is contained in:
William Mantly 2025-03-05 02:54:07 +00:00
parent 00014e2ebd
commit f6162be2e1

View File

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