1

I have come across a situation where when users are imported from other servers or created but when they were created their home directory was not created. Hence, when they log in, they do not land in their home directory, which creates a lot of other issues.

I wanted to know a simple way we can get around this situation, without affecting any other users who already have their home directories.

Victor
  • 9,233
  • 9
  • 23
  • 33
Hrish
  • 2,313
  • 13
  • 42
  • 63

1 Answers1

2

We can achieve this using below command & it will create home directory automatically when they log in, for only those users who do not have it & it also does not affect any other users who have their home directories already set. This command also works for LDAP users & normal local users.

authconfig --enablemkhomedir --update
Hrish
  • 2,313
  • 13
  • 42
  • 63
  • `authconfig` doesn't exist in Ubuntu Desktop (maybe in Server). Where/how do you get it? Oh... I see that you're answering your own question... – heynnema Sep 01 '17 at 01:45
  • @heynnema hey I understand that you are using 14.04 or later earlier it was there, however you can go here to find an answer to your question. https://askubuntu.com/questions/855737/authconfig-command-not-found-ubuntu – Hrish Sep 01 '17 at 15:17
  • I looked at the link. It's not clear how authconfig/sssd have any relation to your original question. Authconfig isn't available to install on 17.04, and sssd deals with hashes/LDAP/etc. I'm just trying to learn from your answer. Maybe you can expand/change your answer to include installation and use. – heynnema Sep 01 '17 at 16:16
  • Actually, this [site](https://www.digitalocean.com/community/tutorials/how-to-authenticate-client-computers-using-ldap-on-an-ubuntu-12-04-vps) suggests editing the file /etc/pam.d/common-session for LDAP clients, at least. – Ray Oct 03 '17 at 16:56