Importing a Keypair

You can import a keypair created with a third-party tool. This action only imports the public key of the keypair, while you keep the private key. The public key is stored by 3DS OUTSCALE, and is only available in the metadata of the virtual machines (VMs) for which the keypair is used. However, the private key is never provided to 3DS OUTSCALE.

You can import a keypair in one of the following types: RSA (2048 bits or preferably 4096 bits), ECDSA (256 bits), and Ed25519. The following formats can be used: PEM, PKCS8, RFC4716, and OpenSSH.

Only RSA keypairs can decrypt the password of a Windows VM.

You can also directly create a 2048-bit RSA keypair using Cockpit or AWS CLI. For more information, see Creating a Keypair.

Importing a Keypair Using Cockpit v2

Before you begin: Create a keypair with a third-party tool. For an example with ssh-keygen, see Creating a Keypair > ssh-keygen.

  1. In the Keypairs dashboard, click IconImport Import Keypair.
    The IMPORT KEYPAIR dialog box appears.

  2. Provide the following information:

    • Click IconExport Upload public keypair file and select the public key of the keypair you want to import.

      Never provide the private key of the keypair as it enables connection to your VMs.

    • In the Name field, type a name for the keypair.

      This name must be unique in your account, and contain between 1 and 255 ASCII printable characters. Accented letters are not allowed.

  3. Click Import.
    The keypair is imported.

Importing a Keypair Using Cockpit v1

Before you begin: Create a keypair with a third-party tool. For an example with ssh-keygen, see Creating a Keypair > ssh-keygen.

  1. Click Network/Security > Keypairs.

  2. Click Import Keypair .
    The IMPORT KEYPAIR dialog box appears.

  3. Provide the following information:

    • In the Name box, type a name for the keypair.

      This name must be unique in your account, and contain between 1 and 255 ASCII printable characters. Accented letters are not allowed.

    • Click Browse ico Cockpit Browse and select the public key of the keypair you want to import.

      Never provide the private key of the keypair as it enables connection to your VMs.

  4. Click Import to validate.
    The keypair is imported and appears on the Keypair page.

Importing a Keypair Using OSC CLI

See the CreateKeypair command sample in the documentation of the OUTSCALE API.

Importing a Keypair Using AWS CLI

Before you begin: Create a keypair with a third-party tool. For an example with ssh-keygen, see Creating a Keypair > ssh-keygen.

To import a keypair, use the import-key-pair command following this syntax:

Request sample
$ aws ec2 import-key-pair \
    --profile YOUR_PROFILE \
    --key-name MyKeyPair \
    --public-key-material fileb://~/.ssh/id_rsa.pub \
    --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-name: A name for the new keypair.

    This name must be unique in your account, and contain between 1 and 255 ASCII printable characters. Accented letters are not allowed.

  • public-key-material: The path to the public key you want to import. The public key you provide must be Base64-encoded, or AWS CLI can encode it for you if you prefix the path with fileb://.

    Never provide the private key of the keypair as it enables connection to your VMs.

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The import-key-pair command returns the following elements:

  • KeyName: The unique name of the newly created keypair.

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

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

A new keypair is imported from the specified public key.

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.