Skip to main content
Rotate keys when credentials may have been exposed, or as part of regular security policy.
from gravixlayer import GravixLayer

client = GravixLayer()
runtime = client.runtime.create(template="python-3.12-base-small")

# Enable SSH
initial = client.runtime.enable_ssh(runtime.runtime_id)
print("Initial connect:", initial.connect_cmd)

# Rotate keys
rotated = client.runtime.enable_ssh(runtime.runtime_id, regenerate_keys=True)
print("New connect:", rotated.connect_cmd)

client.runtime.kill(runtime.runtime_id)
  1. Call enable_ssh with regenerate_keys=True.
  2. Distribute the new private key to authorized operators.
  3. Remove old local key files.
  4. Verify access using the new connect_cmd.