Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-4644

root password specified in blueprint is not set when using "image-installer" compose type

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • rhel-8.7.0
    • osbuild
    • None
    • Moderate
    • rhel-sst-image-builder
    • ssg_front_door
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • If docs needed, set a value
    • None

      Description of problem:

      Creating ISO image with type `image-installer` when we specify "root" user/password in the blueprint, the resulting ISO has the Kickstart file entry "osbuild.ks" creating with the `user` kickstart command for "root" user.

      My blueprint,
      ~~~

      1. composer-cli blueprints show test-blueprint
        name = "test-blueprint"
        description = "Test blueprint"
        version = "0.0.1"
        packages = []
        modules = []
        groups = []
        distro = ""

      [customizations]

      [[customizations.user]]
      name = "root"
      password = "<insert_password_hash_value_here>"
      home = "/root"
      shell = "/usr/bin/bash"
      ~~~

      The resulting ISO contains the Kickstart with "user" command.
      ~~~
      $ cat ~/ISO/osbuild.ks
      liveimg --url file:///run/install/repo/liveimg.tar
      user --name root --password <insert_password_hash_value_here> --iscrypted --shell /usr/bin/bash --homedir /root
      ~~~

      This does not work because the "user" kickstart command can only be used to set password for normal user and not root user.
      The command user for root user password is "rootpw" as per the Kickstart documentation.

      https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/system_design_guide/index#rootpw-required_kickstart-commands-for-system-configuration

      On the installed system we are not able to login and upon booting the system to rescue mode, we can inspect the root filesystem and see that
      Root password is indeed not set and root account is hence locked.
      ~~~

      1. cat /etc/shadow | grep root
        root:!::0:99999:7:::
        ~~~

      During installation with this ISO, we see that the following in the Anaconda GUI,
      ~~~
      USER SETTINGS

      Root Password
      Root account is disabled

      User Creation
      User root will be created
      ~~~

      It does allow for manually setting the root password from the GUI here though.

      Version-Release number of selected component (if applicable):
      ~~~

      1. rpm -qa | grep osbuild
        osbuild-composer-core-62-3.el8_7.x86_64
        osbuild-composer-62-3.el8_7.x86_64
        osbuild-composer-dnf-json-62-3.el8_7.x86_64
        osbuild-lvm2-65-1.el8.noarch
        osbuild-65-1.el8.noarch
        osbuild-luks2-65-1.el8.noarch
        osbuild-selinux-65-1.el8.noarch
        osbuild-composer-worker-62-3.el8_7.x86_64
        osbuild-ostree-65-1.el8.noarch
        python3-osbuild-65-1.el8.noarch
        ~~~

      How reproducible:
      Everytime we build compose type to "image-installer" for creating ISO

      Steps to Reproduce:
      1. Create a Blueprint with [[customization.user]] entry for root user. Create an image-installer type compose for creating ISO and download the ISO
      ~~~

      1. composer-cli blueprints show test-blueprint
        name = "test-blueprint"
        description = "Test blueprint"
        version = "0.0.1"
        packages = []
        modules = []
        groups = []
        distro = ""

      [customizations]

      [[customizations.user]]
      name = "root"
      password = "<insert_password_hash_value_here>"
      home = "/root"
      shell = "/usr/bin/bash"
      ~~~

      1. composer-cli compose start test-blueprint image-installer
      2. composer-cli compose image <UUID>

      2. Mount the ISO and verify the Kickstart file created and verify the kickstart file created has the root user being created with the "user" command and there is no "rootpw" command.

      1. mkdir ~/ISO
      1. mount -v <UUID>-installer.iso ~/ISO
      2. cat ~/ISO/osbuild.ks

      3. Use this ISO for installing a new machine and try login as root user and it should fail.

      Actual results:
      System is not allowing login through root user because password is not set for root user.

      Expected results:
      To set the root password correctly and allow login to root user.

      Additional info:
      This is only occuring for "image-installer" type compose.
      I was able to create qcow2 image which has the correct root password set with this same blueprint when I boot this image
      I also created an AMI image I was not able to boot AMI as I do not have an AWS account, but the raw image file created by osbuild-composer could be mounted and inspect the /etc/shadow and see that the root password is set.

              osbuilders Osbuilders Bot Account
              rhn-support-amepatil Ameya Patil
              Osbuilders Bot Account Osbuilders Bot Account
              RH Bugzilla Integration RH Bugzilla Integration
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: