github.com/tommi2day/pwcli@v0.0.0-20240317203041-4d1177a5ab91/scripts/fetch_sshkey_from_ldap.sh (about) 1 #!/bin/sh 2 # http://pig.made-it.com/ldap-openssh.html 3 ldapsearch -x '(&(objectClass=ldapPublicKey)(uid='"$1"'))' 'sshPublicKey' | \ 4 sed -n '/^ /{H;d};/sshPublicKey:/x;$g;s/\n *//g;s/sshPublicKey: //gp'