]>
git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/ssh/ldap_regular.sh
1 ### This snippet is not standalone and must be integrated in the global ldap_authorized_keys.sh
2 LDAP_MEMBER
="cn=users,cn=ssh,ou=services,dc=immae,dc=eu"
4 ldap_search
'(&(memberOf='$LDAP_MEMBER')('$KEY'=*)(uid='$user'))' $KEY | \
7 if [ ! -z "$line" ]; then
8 if [[ $line == dn
* ]]; then
9 user
=$(sed -n 's/.*uid=\([^,]*\).
*/\
1/p
' <<< "$line")
10 elif [[ $line == $KEY* ]]; then
11 key=$(clean_key_line ssh "$line")
12 if [ ! -z "$key" ]; then
13 if [[ $key != *$'\n'* ]] && [[ $key == ssh-* ]]; then