Skip to content

SshKey

Source: src/Hetzner/SshKey.ts

A Hetzner Cloud SSH key. Public keys are injected into Servers at create time. The public key is immutable — changing it replaces the key.

Generated name

const key = yield* Hetzner.SshKey("deploy", {
publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI… user@host",
});

Explicit name and labels

const key = yield* Hetzner.SshKey("deploy", {
name: "deploy-key",
publicKey: "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI… user@host",
labels: { role: "deploy" },
});