To resolve this issue, you can choose one of the following methods:
- Add the Key: Ensure the required authorized SSH key for the root user is included in the host profile that is attached to the Host.
- Remove the Key: Delete the existing key from the ESXi host's authorized_keys file.
Steps to add authorized Keys:
- The key can be found on the ESXi host at location /etc/ssh/keys-root/authorized_keys
- Compare the compliant and non-complaint hosts. If the keys are presented in the compliant host, add the authorized_keys to the non-complaint hosts.
- SSH to the ESXi Host
- copy the keys from the healthy host from the location "/etc/ssh/keys-root/authorized_keys"
- Paste the keys on the issue host to the location by editing the file authorized_keys in the location.
- To edit the file, use the vi command and paste the copied keys from the healthy host.
## vi /etc/ssh/keys-root/authorized_keys - save the file wq! (write, quit)
- Remediate the host.
Steps to remove authorized keys:
- SSH to the ESXi Host
- Backup the file using cp /etc/ssh/keys-root/authorized_keys /etc/ssh/keys-root/authorized_keys.bak
- Clear contents of the file using the command: echo "" /etc/ssh/keys-root/authorized_keys