Skip to content

bxp-cli ssh

Get an SSH certificate.

Usage

Ask the CA for an SSH certificate and write it next to the key, where
OpenSSH looks for it:

  ~/.ssh/id_rsa.pub   ->  ~/.ssh/id_rsa-cert.pub

With --key, only the public key is sent to the CA. Without it, a new
key is made in ~/.bxp-cli. The server signs RSA keys only. An existing
certificate file is replaced, because SSH certificates are short-lived.

Without --token, your browser opens for a login, and you get a user
certificate with the login names the CA's roles give you. With
--token, the token decides whether this is a user or a host
certificate; a host certificate needs --principal, the host's name.

Usage:
  bxp-cli ssh [flags]

Examples:
  # a user certificate for yourself, with a login in the browser
  bxp-cli ssh --key ~/.ssh/id_rsa.pub

  # a user certificate with a new key in ~/.bxp-cli
  bxp-cli ssh

  # a host certificate
  bxp-cli ssh --token $TOKEN --key /etc/ssh/ssh_host_rsa_key.pub \
      --principal web1.example.com

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")
      --encrypt-key        encrypt the new private key with a passphrase, which is asked
  -h, --help               help for ssh
      --key string         path of an SSH public key, e.g. ~/.ssh/id_rsa.pub (default: a new key in ~/.bxp-cli)
      --no-browser         do not open the browser for the login; print its address instead
      --principal string   the host's name, for a host certificate
      --root string        path of the CA's root certificate
                           (or BXP_CLI_ROOT; default: the one saved by "bxp-cli trust")
      --token string       a one-time token (or BXP_CLI_TOKEN). Without one, you log in in your browser

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