Fix 960: Disable root login (sudo still works) (#962)
This commit is contained in:
parent
159f0d27fc
commit
30d1a5cada
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue