Getting Information About Your Keypairs

You can get information about your imported and generated keypairs.

Information about the public parts of your keypairs is also available from within the associated virtual machines (VMs) themselves. For more information, see Accessing the Metadata and User Data of a VM.

Getting Information About Your Keypairs Using Cockpit v2

See the Keypairs dashboard.

Getting Information About Your Keypairs Using OSC CLI

The ReadKeypairs command lists one or more of your keypairs.

Request sample
$ osc-cli api ReadKeypairs --profile "default" \
    --Filters '{
        "KeypairNames": ["keypair-example"]
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

    • KeypairFingerprints: (optional) The fingerprints of the keypairs.

    • KeypairIds: (optional) The IDs of the keypairs.

    • KeypairNames: (optional) The names of the keypairs.

    • KeypairTypes: (optional) The types of the keypairs (ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521).

    • TagKeys: (optional) The keys of the tags associated with the keypairs.

    • TagValues: (optional) The values of the tags associated with the keypairs.

    • Tags: (optional) The key/value combination of the tags associated with the keypairs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadKeypairs command returns the following elements:

  • Keypairs: Information about one or more keypairs.

    • KeypairFingerprint: The MD5 public key fingerprint as specified in section 4 of RFC 4716.

    • KeypairId: The ID of the keypair.

    • KeypairName: The name of the keypair.

    • KeypairType: The type of the keypair (ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521).

    • Tags: One or more tags associated with the keypair.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Keypairs": [
    {
      "KeypairType": "ssh-rsa",
      "KeypairName": "keypair-example",
      "KeypairId": "key-abcdef1234567890abcdef1234567890",
      "KeypairFingerprint": "11:22:33:44:55:66:77:88:99:00:aa:bb:cc:dd:ee:ff"
    }
  ]
}

Getting Information About Your Keypairs Using oapi-cli

The ReadKeypairs command lists one or more of your keypairs.

Request sample
$ oapi-cli --profile "default" ReadKeypairs \
    --Filters '{
        "KeypairNames": ["keypair-example"]
      }'

This command contains the following attributes that you need to specify:

  • DryRun: (optional) If true, checks whether you have the required permissions to perform the action.

  • Filters: (optional) One or more filters.

    • KeypairFingerprints: (optional) The fingerprints of the keypairs.

    • KeypairIds: (optional) The IDs of the keypairs.

    • KeypairNames: (optional) The names of the keypairs.

    • KeypairTypes: (optional) The types of the keypairs (ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521).

    • TagKeys: (optional) The keys of the tags associated with the keypairs.

    • TagValues: (optional) The values of the tags associated with the keypairs.

    • Tags: (optional) The key/value combination of the tags associated with the keypairs, in the following format: "Filters":{"Tags":["TAGKEY=TAGVALUE"]}.

  • NextPageToken: (optional) The token to request the next page of results. Each token refers to a specific page.

  • ResultsPerPage: (optional) The maximum number of logs returned in a single response (between 1 and 1000, both included). By default, 100.

The ReadKeypairs command returns the following elements:

  • Keypairs: Information about one or more keypairs.

    • KeypairFingerprint: The MD5 public key fingerprint as specified in section 4 of RFC 4716.

    • KeypairId: The ID of the keypair.

    • KeypairName: The name of the keypair.

    • KeypairType: The type of the keypair (ssh-rsa, ssh-ed25519, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521).

    • Tags: One or more tags associated with the keypair.

      • Key: The key of the tag, with a minimum of 1 character.

      • Value: The value of the tag, between 0 and 255 characters.

  • NextPageToken: The token to request the next page of results. Each token refers to a specific page.

  • ResponseContext: Information about the context of the response.

    • RequestId: The ID of the request.

Result sample
{
  "ResponseContext": {
    "RequestId": "0475ca1e-d0c5-441d-712a-da55a4175157"
  },
  "Keypairs": [
    {
      "KeypairType": "ssh-rsa",
      "KeypairName": "keypair-example",
      "KeypairId": "key-abcdef1234567890abcdef1234567890",
      "KeypairFingerprint": "11:22:33:44:55:66:77:88:99:00:aa:bb:cc:dd:ee:ff"
    }
  ]
}

Getting Information About Your Keypairs Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To get information about one or more keypairs, use the describe-key-pairs command following this syntax:

Request sample
$ aws ec2 describe-key-pairs \
    --profile YOUR_PROFILE \
    --key-name MyKeyPair \
    --endpoint https://fcu.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • key-names: The name of one or more keypairs about which you want to get information.

  • (optional) filters: One or more filters. The following filters are available:

    • key-name: The name of one or more keypairs.

    • key-fingerprint: The MD5 public key fingerprint as specified in section 4 of RFC 4716.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The describe-key-pairs command returns the following elements:

  • KeyPairs: Information about one or more keypairs. This element contains the following information:

    • KeyName: The name of the keypair.

    • KeyFingerprint: The MD5 public key fingerprint as specified in section 4 of RFC 4716.

Result sample
{
    "KeyPairs": [
        {
            "KeyName": "MyKeyPair",
            "KeyFingerprint": "1a:11:aa:11:aa:11:a1:a1:1a:11:1a:11:1a:1a:a1:aa"
        }
    ]
}

Related Pages

Corresponding API Methods

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.