diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-16 14:40:52 +0100 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-07-16 14:40:52 +0100 |
commit | 1557f4c63785f46979ca4ce1cbd889c0a680b084 (patch) | |
tree | 8f82c37eedffa7e7112e666fcc644ea831645029 | |
parent | 95bcd705060de5255950ac6c2af39578b077bbf3 (diff) | |
download | vmdebootstrap-1557f4c63785f46979ca4ce1cbd889c0a680b084.tar.gz |
Create password-less accounts when requested
-rwxr-xr-x | vmdebootstrap | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/vmdebootstrap b/vmdebootstrap index c8fc426..93bb2c6 100755 --- a/vmdebootstrap +++ b/vmdebootstrap @@ -237,7 +237,7 @@ class VmDebootstrap(cliapp.Application): self.runcmd(['chroot', rootdir, 'passwd', '-l', 'root']) else: self.message('Give root an empty password') - self.runcmd(['chroot', rootdir, 'passwd', '-d', 'root']) + self.delete_password(rootdir, 'root') def create_users(self, rootdir): def create_user(user): @@ -253,11 +253,15 @@ class VmDebootstrap(cliapp.Application): self.set_password(rootdir, user, password) else: create_user(userpass) + self.delete_password(rootdir, userpass) def set_password(self, rootdir, user, password): encrypted = crypt.crypt(password, '..') self.runcmd(['chroot', rootdir, 'usermod', '-p', encrypted, user]) + def delete_password(self, rootdir, user): + self.runcmd(['chroot', rootdir, 'passwd', '-d', user]) + def remove_udev_persistent_rules(self, rootdir): self.message('Removing udev persistent cd and net rules') for x in ['70-persistent-cd.rules', '70-persistent-net.rules']: |