Skip to content

Elastic Compute Cloud (EC2) - import-key-pair error #1796

Open
@deepaksorthiya

Description

@deepaksorthiya

aws ec2 import-key-pair --key-name my-key --public-key-material file://~/.ssh/id_rsa.pub

gives an error Invalid base64: "ssh-rsa....................

workaround
Use fileb:// in order for AWS CLI version 2 to treat the file content as unencoded binary.
https://docs.aws.amazon.com/cli/latest/userguide/cliv2-migration.html#cliv2-migration-binaryparam
aws ec2 import-key-pair --key-name "eksworkshop" --public-key-material fileb://~/.ssh/id_rsa.pub

More Info

awslabs/ec2-spot-workshops#48

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions