From 0e475df858503a8b30febe99c1c422e4c7cdca9a Mon Sep 17 00:00:00 2001 From: Yi Zhao Date: Mon, 9 Aug 2021 17:30:50 +0800 Subject: [PATCH] secure-core-image: pass encrypted password rather than plaintext password to usermod In oe-core commit 759df7395908f18b3b68f28d043ac9ebd42dd0c8, the plaintext password setting function was dropped because of the security issue. So the plaintext password setting method "usermod -P 'password' user" is not available. Now we should pass the encrypted password to usermod via -p option. Signed-off-by: Yi Zhao --- meta/recipes-core/images/secure-core-image.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meta/recipes-core/images/secure-core-image.bb b/meta/recipes-core/images/secure-core-image.bb index 3621b2d..9c0ede8 100644 --- a/meta/recipes-core/images/secure-core-image.bb +++ b/meta/recipes-core/images/secure-core-image.bb @@ -5,4 +5,5 @@ IMAGE_INSTALL += "\ " inherit extrausers -EXTRA_USERS_PARAMS += "usermod -P toor root;" +# Set the root password to toor +EXTRA_USERS_PARAMS += "usermod -p '\$6\$cnS1MQVd07.jLdkj\$NgXwgR.LWtbi4qD3Drn6x0AQtVtX/CdfKPy1eJzuUC0YdD8s54fLAlsLm8vaoacAoqq6BHYGTAbUnAUNJKTOb1' root;"