Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I want to enable pam_mkhomedir.so 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 pam_mkhomedir.so into /etc/pam.d/sshd .

However, could pam_mkhomedir.so 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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.