Uploaded image for project: 'OpenShift Virtualization'
  1. OpenShift Virtualization
  2. CNV-30335

[2217919] User cannot use 'virtcl ssh' command if key is not injected into VM before first boot

XMLWordPrintable

    • Important
    • No

      Description of problem:
      If a static public key is injected into a VM after it has booted for the first time, the 'virtctl ssh' command does not work.

      This is, IMO, a serious problem because the SSH command is exposed in several places in the UI (VirtualMachines -> VirtualMachine details). However, if the user keeps the default Quick Create setting (start VM immediately), it is too late to add the SSH key. There is no warning in the QuickCreate modal to clear the "Start VM" checkbox if the user wants to be able to connect with virtctl SSH.

      I encountered the same issue when I created a NodePort service for SSH.

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

      How reproducible:

      Steps to Reproduce:
      1. Create a RHEL VM. (I tested both RHEL 8 and 9.)
      2. Do not clear the "Boot VM after creation" checkbox.
      3. After the VM is created and boots, add a static public key (new or existing secret) to the VM.
      4. Reboot the VM to apply the change.
      5. Copy the 'virtctl ssh' command and try to run it from the command line.

      Actual results: Permission denied error.

      Expected results: SSH connection works.

      Additional info: Possible solution might be to disable the "Start VM" checkbox by default and add a tooltip saying that the key needs to be injected before first boot in order for SSH connection to work.

      I noticed a separate issue but am not sure whether it is worth filing a bug for it. I had a VM that I could connect to using 'virtctl ssh'. I deleted the secret from my namespace and removed it from the VM. After rebooting the VM, I was still able 'virtctl ssh' to connect to the VM.

              tnisan@redhat.com Tal Nisan
              apinnick@redhat.com Avital Pinnick
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: