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.

    • 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).

  • 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.

    • 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).

  • 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",
      "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

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.

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.