0

While creating eks cluster using EKSCTL it is throwing error like error decoding SSH public key

Permission of pem file is 400

Command i am executing

eksctl create cluster --name=thirdekscluster --ssh-access --ssh-public-key=mysshkey.pem --nodegroup-name=standard-workers --node-type=t3.medium --nodes=3 --nodes-min=1 --nodes-max=4 --node-ami=auto

Error:

[ℹ]  using region ap-south-1
[ℹ]  setting availability zones to [ap-south-1a ap-south-1c ap-south-1b]
[ℹ]  subnets for ap-south-1a - public:xxxxx/19 private:xxxx/19
[ℹ]  subnets for ap-south-1c - public:xxxxx/19 private:xxxx/19
[ℹ]  subnets for ap-south-1b - public:xxxxx/19 private:xxxx/19
[ℹ]  nodegroup "standard-workers" will use "ami-01b6a163133c31994" [AmazonLinux2/1.12]
[✖]  computing fingerprint for key "mysshkey.pem": 
error decoding SSH public key: 

"-----BEGIN RSA PRIVATE KEY
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-----END RSA PRIVATE KEY-----" 

err: illegal base64 data at input byte 0
Sreejith
  • 434
  • 3
  • 19

5 Answers5

3

I had the same ploblem, in my case I was trying to use the private key instead of public. (key was created directly on aws ec2 console panel)

Solution: ssh-keygen -y -f .pem >> <> .pem (just an ilustrative name).

3

Thanks for your response, but i sorted out myself.

created cluster using - eksctl create cluster --name=thirdekscluster --ssh-access=true --ssh-public-key=sreeeks --nodegroup-name=standard-workers --node-type=t3.medium --nodes=3 --nodes-min=1 --nodes-max=4 --node-ami=auto

The SSH part in the command should be like --ssh-access=true

Sreejith
  • 434
  • 3
  • 19
1

I used Bitvise Client Key Management to export in OpenSSH format. After that, eksctl worked!

0

For me it worked as I removed the BOM by copying the public key to a different txt file.

-1
eksctl create cluster --ssh-access --ssh-public-key=~/.ssh/id_rsa.pub --nodegroup-name=standard-workers --node-type=t3.medium --nodes=2 --nodes-min=1 --nodes-max=2

This should definitely work.

ouflak
  • 2,458
  • 10
  • 44
  • 49