I would like to enable the following: Linux ec2 instances in AWS that perform LDAP authentication of users who have no home directory currently on the box. I have a working openLDAP in AWS for the task
Once LDAP authenticated:
- The user's home directory will get created
- The user's public ssh key is retrieved from their
sshPublicKeyattribute in LDAP and they can only log on if their local sshPrivateKey matches
I know how to do LDAP auth OR retrieval of public key via an ldapsearch but I want to do both.
The scenario I am trying to mitigate against is when an employee leaves the company: I can just disable their account in openLDAP and even if their public key exists on machines, they won't be able to use them because they will also fail ldap auth.
I've hunted round on StackExchanges and don't think I've found what I'm looking for. The closest I've come is
loginShellto/bin/falseor/usr/sbin/nologinin LDAP if you're reading this attribute. – Jakub Jindra Mar 29 '19 at 09:56/etc/passwd, it will be the same. He would be able to authenticate, but then his loginShell won't let him in. Better approach is use one LDAP attribute to differentiate enabled and disabled users. And filter by this attribute. The user will simply disappear from the system. – Jakub Jindra Mar 29 '19 at 10:07