How do I set the root password in a kickstart file?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8

Issue

  • How to create an encrypted password that is suitable for use in a kickstart file.

Resolution

  • There are two options:
  1. Set the password in plaintext in the kickstart using the rootpw option, but leaving out the --iscrypted flag. While it is unencrypted in the kickstart file it will be encrypted on the installed system in /etc/shadow.

  2. Follow Solution 221403 to generate a hashed password then pass the resulting string to the rootpw --iscrypted option in the kickstart.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments