Skip to content

bxp-cli renew

Renew a server or SSH host certificate before it expires: no token, no login.

Usage

Renew a TLS server certificate, or an SSH host certificate, with the
current certificate and its key as the proof. Nobody has to hand out a token.

It does nothing while more than a third of the certificate's lifetime is
left, so run it often from a timer: it renews at the right moment by
itself. With --force, it renews at once: after a CA was revoked, run it
once on every server, from your configuration tool.

TLS: a new key is made, and the key and certificate files are replaced.
SSH: the certificate file is replaced; the host key stays the same.
The new certificate has the same names as the old one.

A certificate that has expired or was revoked cannot be renewed; it
needs a new one with a token. Only certificates from "bxp-cli tls" and
"bxp-cli ssh" with a host token renew this way.

Usage:
  bxp-cli renew [flags]

Examples:
  bxp-cli renew --cert web.example.com.crt --key web.example.com.key \
      --exec "systemctl reload nginx"

  bxp-cli renew --force --cert /etc/ssh/ssh_host_ed25519_key-cert.pub \
      --key /etc/ssh/ssh_host_ed25519_key --exec "systemctl reload sshd"

Flags:
      --authority string   ID of the certificate authority on the server
                           (or BXP_CLI_AUTHORITY; default: the one saved by "bxp-cli trust")
      --ca-url string      address of the BastionXP server, e.g. https://bastionxp.example.com
                           (or BXP_CLI_CA_URL; default: the one saved by "bxp-cli trust")
      --cert string        the certificate to renew: a TLS .crt file, or an SSH ...-cert.pub file
      --exec string        a command to run after a renewal, e.g. "systemctl reload nginx"
      --force              renew now, even if more than a third of the lifetime is left
  -h, --help               help for renew
      --key string         its private key
      --root string        path of the CA's root certificate
                           (or BXP_CLI_ROOT; default: the one saved by "bxp-cli trust")

Global Flags:
  -v, --verbose   show each step on stderr (or BXP_CLI_LOG_LEVEL=debug)