diff options
author | Mina Galić <freebsd@igalic.co> | 2023-05-16 22:37:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-16 15:37:42 -0600 |
commit | 8c1a3ff8024377e2efed51c461c1190c25da9d23 (patch) | |
tree | 48c60bbfe9415f9f401492c02f9b291f4849c31f | |
parent | 21006925f17815fc79e9a15f80088b1585e6f1a6 (diff) | |
download | cloud-init-git-8c1a3ff8024377e2efed51c461c1190c25da9d23.tar.gz |
FreeBSD: Fix user account locking (#4114)
On Linux, we only disable login via Password authentication.
On FreeBSD, we were right out locking the account.
This was reported back when #93 was merged, but back then I didn't
understand that.
Newly created FreeBSD users can now login with with SSH keys.
Sponsored by: The FreeBSD Foundation
LP: #1854594
Fixes: #3507
-rw-r--r-- | cloudinit/distros/freebsd.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py index 443d0961..32cff9b9 100644 --- a/cloudinit/distros/freebsd.py +++ b/cloudinit/distros/freebsd.py @@ -148,9 +148,9 @@ class Distro(cloudinit.distros.bsd.BSD): def lock_passwd(self, name): try: - subp.subp(["pw", "usermod", name, "-h", "-"]) + subp.subp(["pw", "usermod", name, "-w", "no"]) except Exception: - util.logexc(LOG, "Failed to lock user %s", name) + util.logexc(LOG, "Failed to lock password login for user %s", name) raise def apply_locale(self, locale, out_fn=None): |