Lock root account

This update stops setting the root password and locks the root account

Test Plan:

PASS: Verify root account can't be logged into with 'root' as password.
PASS: Verify can set root password with 'sudo passwd root'

Story: 2009968
Task: 46997
Signed-off-by: Eric MacDonald <eric.macdonald@windriver.com>
Change-Id: I5ae53c2e457ffba3cdaea7bb45ff82bb60945083
This commit is contained in:
Eric MacDonald 2022-12-06 12:53:13 +00:00
parent 07640af5df
commit dcc78cfdb9

View File

@ -2006,8 +2006,16 @@ HOOK_LABEL="post"
ilog "*********************************************************"
ilog "**** Post - Add user/groups **"
ilog "*********************************************************"
# Set password for root to 'root'
usermod -p '$6$hEv/K.fPeg/$ezIWhJPrMG3WtdEwqQRdyBwdYmPZkqW2PONFAcDd6TqWliYc9dHAwW4MFTlLanVH3/clE0/34FheDMpbAqZVG.' root
# usermod -p '$6$hEv/K.fPeg/$ezIWhJPrMG3WtdEwqQRdyBwdYmPZkqW2PONFAcDd6TqWliYc9dHAwW4MFTlLanVH3/clE0/34FheDMpbAqZVG.' root
# To enable root password
# 1. Uncomment set root password command above
# 2. Comment out 'passwd -l root' command below
# Lock the root password
passwd -l root
# Remove admin user whether it exists or not
deluser admin || true