AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.


#Power
#Power
 View Only

LDAP attributes caching - ldapgetusrattr

  • 1.  LDAP attributes caching - ldapgetusrattr

    Posted Mon February 07, 2022 12:34 PM
    This post is here to highlight that some LDAP attributes are cached locally (like sshPublicKey)
    This command is named ldapgetusrattr.This command was released not so long ago (~1 year)

    Example of script you can use in sshd_config to get the SSH public key of a user:
    SSH_USER="${1}"

    if [ -f /usr/sbin/ldapgetusrattr ]; then
    /usr/sbin/ldapgetusrattr $SSH_USER sshPublicKey
    else
    lsldap -a passwd $SSH_USER | nawk -F': ' '/sshPublicKey:/ { print $2 }'
    fi

    Cheers

    ------------------------------
    Lionel Widmer
    ------------------------------