hp-create-user: remove password-setting #5
Loading…
Reference in a new issue
No description provided.
Delete branch "passwordless"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This should allow the script to be fully noninteractive.
--disabled-passwordeliminates the prompt for a password in theadduserinvocation, but sets the password hash to!.passwd --deletedeletes the hash entirely, which allows the user to set a new password without knowing the previous password, because it goes down this code path instead.I like this, only thing worth noting is it boots the user, luckily we get a warning here like so but I think it's fine (as long as people read it)
Hmm this does pose a potential issue where someone else logged in can
su newuserbefore that user has a chance to set there password. That is one nice thing about the initial password approach. Not sure if thats super a concern or not though, let me know what you think@jacob wrote in #5 (comment):
Isn't forcing a second login the current behavior already, for all forced password changes? That text is straight from openssh.
@jacob wrote in #5 (comment):
I thought leaving
nullokoff in PAM (the default) would prevent this. Are you sure that works?Ha! it certainly is, I was misremembering.
As for the second part:
It appears to work for me, though this may be because I am in a sudo adjacent mode? I will check we actually have nullok off in our pam config.
PAM's upstream default is off, but it turns out Debian has historically enabled
nullokby default.https://www.debian.org/doc/manuals/securing-debian-manual/restrict-console-login.en.html
RIP undisclosed default password system