A guide for reinstalling SSH keys on your Vultr Optimized Cloud Compute instance to restore secure access.
SSH keys enable secure, password-free authentication for users accessing your instance over SSH. Reinstalling SSH keys resets the instance, wiping all data and reinstalls the operating system to apply the new SSH key details.
Follow this guide to reinstall SSH keys on a Vultr Optimized Cloud Compute instance using the Vultr Customer Portal, or Terraform.
Open your Terraform configuration for the existing Optimized Cloud Compute instance.
Update the ssh_key_ids
in the instance resource to reference the new SSH key(s).
resource "vultr_ssh_key" "new_key" {
name = "mbp-ed25519"
public_key = file("~/.ssh/id_ed25519.pub")
}
resource "vultr_instance" "occ" {
# ...existing fields (region, plan, os_id, label, etc.)
ssh_key_ids = [vultr_ssh_key.new_key.id]
}
Apply the configuration and observe the following output:
Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
No comments yet.