lock_passwd (default_user) vs lock-passwd (normal user)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Medium
|
Unassigned |
Bug Description
In our use case we only have one user we create with the cloud-init configuration file. We need a password set for this user so we configured him as the default_user as follows:
system_info:
default_user:
name: demo
passwd: PASSWORDHASH
shell: /bin/bash
lock-passwd: False
But the password was always locked over and over again.
After some troubleshooting I figured the lock param was wrong. Apparently for a normal user it's lock-passwd (with a hyphen) but for the default user it's lock_passwd (with an underscore)
To me this was very confusing and I lost a lot of time on this little difference. Is there any particular reason why the differ? Wouldn't it be a better idea to streamline them using only one of the two options for both?
So the reason for this is somewhat historical.
You should be able to use 'lock_passwd' for either case, but lock-passwd will only affect non-default users.