Add lock_passwd false to Alpine user config
This commit is contained in:
@@ -8,10 +8,19 @@ preserve_hostname: false
|
|||||||
# 2. User creation
|
# 2. User creation
|
||||||
# On Alpine, the privilege escalation group is "wheel" (not "sudo").
|
# On Alpine, the privilege escalation group is "wheel" (not "sudo").
|
||||||
# Keep the default shell (ash/busybox) to stay lightweight.
|
# Keep the default shell (ash/busybox) to stay lightweight.
|
||||||
|
#
|
||||||
|
# IMPORTANT: lock_passwd MUST be false on Alpine.
|
||||||
|
# cloud-init's default (lock_passwd: true) sets shadow to "!", which Alpine's
|
||||||
|
# OpenSSH (compiled without PAM) interprets as "account locked" and refuses
|
||||||
|
# pubkey auth with "User ... not allowed because account is locked".
|
||||||
|
# Setting lock_passwd: false lets cloud-init use "*" instead: no password
|
||||||
|
# login possible, but pubkey works.
|
||||||
users:
|
users:
|
||||||
- name: ${username}
|
- name: ${username}
|
||||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||||
groups: wheel
|
groups: wheel
|
||||||
|
shell: /bin/ash
|
||||||
|
lock_passwd: false
|
||||||
ssh_authorized_keys:
|
ssh_authorized_keys:
|
||||||
- ${ssh_key}
|
- ${ssh_key}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user