Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to enable for users who authenticate to our system. I want a user's home directory to be created when they SSH into the box.

One common convention seems to be to put into /etc/pam.d/sshd .

However, could actually be placed into /etc/pam.d/login , so that home directories are upon login?

Pretend that I want the home directory to be created when a user logs into the box using sftp, telnet, or another method.

share|improve this question
up vote 2 down vote accepted

It seems like you have correctly stated the two options. You can put any given PAM module in a service-specific configuration (like /etc/pam.d/sshd) or in a common location where it will be used by multiple services.

Which choice you make depends entirely on your local requirements. Maybe you only want to auto-provision home directories if someone successfully logs in via ssh, but otherwise treat missing home directories as missing (so someone cannot log in via telnet or ftp until they first successfully connect with ssh).

...and of course if ssh is the only mechanism by which people can log in to your system, it doesn't really matter.

That said, I would probably place pam_mkhomedir in a common location.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.