summaryrefslogtreecommitdiff
path: root/cloudinit/distros/freebsd.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/distros/freebsd.py')
-rw-r--r--cloudinit/distros/freebsd.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py
index c55f8990..8e5ae96c 100644
--- a/cloudinit/distros/freebsd.py
+++ b/cloudinit/distros/freebsd.py
@@ -234,6 +234,13 @@ class Distro(distros.Distro):
if passwd_val is not None:
self.set_passwd(name, passwd_val, hashed=True)
+ def expire_passwd(self, user):
+ try:
+ util.subp(['pw', 'usermod', user, '-p', '01-Jan-1970'])
+ except Exception as e:
+ util.logexc(LOG, "Failed to set pw expiration for %s", user)
+ raise e
+
def set_passwd(self, user, passwd, hashed=False):
if hashed:
hash_opt = "-H"