SUMMARY Simplest way to create home directory for AD/LDAP user
Hi esteemed colleagues,
I am working on a major project which involves lot of automation tasks and one of the challenges was to add public SSH key for a special AD user at the time when the RHEL server is built.
The problem was to add ~user/.ssh/authorized_keys when there was no home directory (since the AD user never logged in beforehand).
Specific automation tools did not provide such an ability.
As a classically-trained electronics/telecommunications engineer, I went to basics. This worked:
$ sudo mkhomedir_helper myadduser
This simple tool is idempotent.
Then, it was easy to use automation tools to upload the public SSH key...
Maybe this helps someone who has similar struggle.
Probably there are other solutions too.
Regards,
Dusan Baljevic (amateur radio VK2COT)