Regenerate and install a new ssh key pair for the Ops Manager VM
search cancel

Regenerate and install a new ssh key pair for the Ops Manager VM

book

Article ID: 373243

calendar_today

Updated On:

Products

Ops Manager

Issue/Introduction

This article provides steps to regenerate and install a new ssh key pair for a vSphere Ops Manager VM if the private key becomes lost.

Environment

  • vSphere
  • vCenter
  • Ops Manager

Resolution

Follow the below steps to regenerate the new ssh key pair and update the Opsman OVF settings.

  1. Generate a new ssh key pair from a Linux jumpbox:
    • ssh-keygen -t rsa -b 4096 -f ~/.ssh/opsman_ssh_key
  2. A private key /home/USER/.ssh/opsman_ssh_key and public key /home/USER/.ssh/opsman_ssh_key.pub will be generated.
  3. Shutdown the Opsman VM in vCenter
  4. In the VM page, click Configure->vApp Options.  Under Properties, click the radio button for public_ssh_key.  Click "DELETE".
  5. Click "ADD".  Set Label as "Public SSH Key".  Set Key ID as "public_ssh_key".
  6. Click "Type" tab. Add the contents of the opsman_ssh_key.pub file into the "Default value" field.  Click "SAVE".
  7. Power on the Opsman VM in vCenter
  8. Update the private key for any SSH applications or jumpbox that's using it.
  9. You might also need to remove the old key from the known_hosts file in the .ssh directory.
  10. Login to the Ops Manager VM using the new key.  Once in the Ops Manager VM, you may edit the ~/.ssh/authorized_keys file to remove the old SSH key (it would be at the top of the file).  The new SSH key would be at the bottom of the file.