saltstack/salt — comment on commit dfc994b8fd4cd1f88ff6425196c51447c572c677
File: salt/states/ssh_auth.py line 71
By SEJeff:

Ghostbusters! The original one! Great quote there @whiteinge!

@thatch45 : If you are creating ssh keys for a user, you know that for ssh auth to work the homedir, .ssh dir, and authorized_keys file needs to be owned as the user they are being installed for. The principal of least surprise (and a cool feature) would be that if the homedir doesn't exist, create it with the same ownership as the user who the ssh key is for.

If you wanted to take that a step further, add a feature to the user module for copying all of /etc/skel to the new user's home directory (which useradd does automatically btw) for cases where the homedir is manually created, and you don't want the user's environment to be weird due to a missing ~/.bashrc.

Make sense?