keypair

The badly named keypair is really the public key of an OpenSSH key pair to be used for access to created servers. You can also create a private key for access to a created server by not passing any argument to the keypair create command.

Compute v2

keypair create

Create new public or private key for server ssh access

openstack keypair create
    [--public-key <file> | --private-key <file>]
    [--type <type>]
    [--user <user>]
    [--user-domain <user-domain>]
    <name>
--public-key <file>

Filename for public key to add. If not used, creates a private key.

--private-key <file>

Filename for private key to save. If not used, print private key in console.

--type <type>

Keypair type. Can be ssh or x509. (Supported by API versions ‘2.2’ - ‘2.latest’)

--user <user>

The owner of the keypair. (admin only) (name or ID). Requires --os-compute-api-version 2.10 or greater.

--user-domain <user-domain>

Domain the user belongs to (name or ID). This can be used in case collisions between user names exist.

name

New public or private key name

keypair delete

Delete public or private key(s)

openstack keypair delete
    [--user <user>]
    [--user-domain <user-domain>]
    <key>
    [<key> ...]
--user <user>

The owner of the keypair. (admin only) (name or ID). Requires --os-compute-api-version 2.10 or greater.

--user-domain <user-domain>

Domain the user belongs to (name or ID). This can be used in case collisions between user names exist.

key

Name of key(s) to delete (name only)

keypair list

List key fingerprints

openstack keypair list
    [--sort-column SORT_COLUMN]
    [--sort-ascending | --sort-descending]
    [--user <user>]
    [--user-domain <user-domain>]
    [--project <project>]
    [--project-domain <project-domain>]
    [--marker MARKER]
    [--limit LIMIT]
--sort-column SORT_COLUMN

specify the column(s) to sort the data (columns specified first have a priority, non-existing columns are ignored), can be repeated

--sort-ascending

sort the column(s) in ascending order

--sort-descending

sort the column(s) in descending order

--user <user>

Show keypairs for another user (admin only) (name or ID). Requires --os-compute-api-version 2.10 or greater.

--user-domain <user-domain>

Domain the user belongs to (name or ID). This can be used in case collisions between user names exist.

--project <project>

Show keypairs for all users associated with project (admin only) (name or ID). Requires --os-compute-api-version 2.10 or greater.

--project-domain <project-domain>

Domain the project belongs to (name or ID). This can be used in case collisions between project names exist.

--marker <MARKER>

The last keypair ID of the previous page

--limit <LIMIT>

Maximum number of keypairs to display

keypair show

Display key details

openstack keypair show
    [--public-key]
    [--user <user>]
    [--user-domain <user-domain>]
    <key>
--public-key

Show only bare public key paired with the generated key

--user <user>

The owner of the keypair. (admin only) (name or ID). Requires --os-compute-api-version 2.10 or greater.

--user-domain <user-domain>

Domain the user belongs to (name or ID). This can be used in case collisions between user names exist.

key

Public or private key to display (name only)