diff --git a/pmb/install/install.py b/pmb/install/install.py index 160da745..72a249bf 100644 --- a/pmb/install/install.py +++ b/pmb/install/install.py @@ -117,10 +117,12 @@ def set_user(args): pmb.chroot.root(args, ["addgroup", args.user, "wheel"], suffix) -def set_user_password(args): +def setup_login(args): """ - Loop until the passwords for user and root have been changed successfully. + Loop until the password for user has been set successfully, and disable root + login. """ + # User password logging.info(" *** SET LOGIN PASSWORD FOR: '" + args.user + "' ***") suffix = "rootfs_" + args.device while True: @@ -132,6 +134,9 @@ def set_user_password(args): " one more time.") pass + # Disable root login + pmb.chroot.root(args, ["passwd", "-l", "root"], suffix) + def copy_ssh_key(args): """ @@ -315,7 +320,7 @@ def install(args): pmb.chroot.initfs.build(args, flavor, suffix) # Set the user password - set_user_password(args) + setup_login(args) # Set the keymap if the device requires it setup_keymap(args)