The BastionXP client: bxp-cli¶
bxp-cli is the command-line client of BastionXP. It gets SSH and TLS
certificates from a BastionXP certificate authority. You run it on any
machine that needs a certificate: a laptop, a server or a virtual machine.
bxp-cli only gets certificates. It does not open SSH connections. To log in to
a server, you use your usual ssh client, with the certificate that bxp-cli
got for you. See SSH certificates.
Install¶
Follow the instructions to download and install
the BastionXP client bxp-cli on your machine.
Then check that it runs:
The commands¶
| Command | What it does |
|---|---|
bxp-cli trust |
Makes this machine trust a BastionXP CA. This is the first step on every machine. |
bxp-cli tls |
Creates a key, and gets a TLS certificate for it. |
bxp-cli ssh |
Gets an SSH certificate for a user or for a host. |
bxp-cli renew |
Renews a server certificate or an SSH host certificate before it expires. It needs no token and no login. |
bxp-cli acme |
Gets, renews and revokes TLS certificates with the ACME protocol. It needs no token and no login. |
bxp-cli scep |
Gets, renews or fetches a TLS certificate with the SCEP protocol. |
Every command explains itself with --help. The
CLI reference lists every command and all its
flags.
How you use it¶
First, trust the CA. You do this once on each machine, for each user. Your BastionXP administrator gives you the CA's address, the authority's ID and the root CA's fingerprint:
bxp-cli trust --ca-url https://ca.example.com --authority my-ca \
--fingerprint <SHA-256 fingerprint of the CA's root certificate>
See Trust the CA.
Then get certificates. To get a certificate with bxp-cli tls or bxp-cli ssh,
you must prove who you are. There are two ways:
| How you prove who you are | What you can get | Example |
|---|---|---|
| You log in in your browser, with your company's SSO account. | Certificates for yourself, as a user. | bxp-cli ssh |
| You give a one-time token, which an admin created in the BastionXP portal. | User certificates, and certificates for servers. | bxp-cli tls --token $TOKEN --name web1.example.com |
ACME and SCEP work differently, and need neither a login nor a token. With ACME, the machine proves that the names in the certificate belong to it. With SCEP, the device knows a challenge password.
Here is bxp-cli ssh with an SSO login:
$ bxp-cli ssh
Log in in your browser. If it does not open, go to:
http://127.0.0.1:53817/login
Certificate: /home/bob/.bxp-cli/ssh_user-cert.pub
Private key: /home/bob/.bxp-cli/ssh_user
Principals: bob, admin
Valid until: 2026-11-19 22:37 UTC
Roles: admins
Host CA key: /home/bob/.bxp-cli/ssh_host_ca-cert.pub
Where it keeps its files¶
bxp-cli keeps its settings, and the CA's certificates, in the .bxp-cli folder in
your home directory:
| File | What it is |
|---|---|
config.json |
The CA's address and the authority's ID. bxp-cli trust saves them. |
tls_root_ca.crt |
The CA's root certificate. bxp-cli trust saves it. |
ssh_user, ssh_user-cert.pub |
A key that bxp-cli ssh made for you, and its user certificate. bxp-cli ssh makes this key when you do not give one with --key. |
ssh_host, ssh_host-cert.pub |
The same, for a host certificate. |
ssh_host_ca-cert.pub |
The SSH host CA. SSH clients add it to known_hosts, to trust the servers' host certificates. |
ssh_user_ca.pub |
The SSH user CA. SSH servers name it in TrustedUserCAKeys, to accept users' certificates. |
host_ids.json |
The ID that the CA gave each host. It lets a host get a new certificate for the same name later. |
acme/, scep/ |
The folders where bxp-cli acme and bxp-cli scep keep their files by default. |
bastionxp.log |
The client's log. |
Each user has their own ~/.bxp-cli folder. A command that you run with sudo
uses root's folder instead. See Configuration.
Questions
If you have any questions or suggestions, please email us at: support@bastionxp.com