Skip to content

bb ssh-key

Add, list and remove your SSH keys

3 commands.

bb ssh-key add
Add a personal SSH key
bb ssh-key list
List personal SSH keys
bb ssh-key remove
Remove a personal SSH key by ID

bb ssh-key add

Add a personal SSH key

bb ssh-key add <key-file-or-text> [flags]
# Add your public key
bb ssh-key add ~/.ssh/id_ed25519.pub --label "Work laptop"
--label string
Label/comment for the SSH key

Also takes the global flags.

Dry run: Shows the change it would make, without making it; nothing is checked first (predicted)

Output with --json, where ? marks a field that can be absent
data
  id?                 integer  Identifier to pass to bb auth ssh-key remove.
  label?              string   Label the key was added under.
  fingerprint?        string   Fingerprint Bitbucket computed for the key.
  algorithmType?      string   Key algorithm, for example RSA or ED25519.
  bitLength?          integer  Key length in bits.
  createdDate?        integer  When the key was added, in milliseconds since the epoch.
  expiryDays?         integer  Days until the key expires, when the instance enforces expiry.
  lastAuthenticated?  string   When the key was last used to authenticate, when the instance records it.
  warning?            string   A warning from Bitbucket about the key, for example that its algorithm is deprecated.
  text?               string   The public key itself.

bb ssh-key list

List personal SSH keys

bb ssh-key list [flags]
# Your SSH keys
bb ssh-key list
--all
Return every result rather than the first --limit
--limit int
Maximum number of results to return (default 25)
--start int
Start offset for list operations

Also takes the global flags.

Dry run: Runs as usual: this command changes nothing, so there is nothing to hold back

Output with --json, where ? marks a field that can be absent
data                  list of object
  id?                 integer         Identifier to pass to bb auth ssh-key remove.
  label?              string          Label the key was added under.
  fingerprint?        string          Fingerprint Bitbucket computed for the key.
  algorithmType?      string          Key algorithm, for example RSA or ED25519.
  bitLength?          integer         Key length in bits.
  createdDate?        integer         When the key was added, in milliseconds since the epoch.
  expiryDays?         integer         Days until the key expires, when the instance enforces expiry.
  lastAuthenticated?  string          When the key was last used to authenticate, when the instance records it.
  warning?            string          A warning from Bitbucket about the key, for example that its algorithm is
                                      deprecated.
  text?               string          The public key itself.

bb ssh-key remove

Remove a personal SSH key by ID

bb ssh-key remove <ssh-key-id> [flags]
# By the id bb ssh-key list prints
bb ssh-key remove 31
-y, --yes
Confirm without being asked

Also takes the global flags.

Dry run: Shows the change it would make, without making it; nothing is checked first (predicted)

Output with --json, where ? marks a field that can be absent
data
  status  string  Outcome of the command.
  key     string  Identifier of the key that was removed.