Skip to content
This repository has been archived by the owner on Apr 6, 2024. It is now read-only.

error parsing SSH public key: ssh: no key found #68

Closed
liuevan48 opened this issue Apr 16, 2019 · 5 comments
Closed

error parsing SSH public key: ssh: no key found #68

liuevan48 opened this issue Apr 16, 2019 · 5 comments

Comments

@liuevan48
Copy link

I run into following issues when creating the cluster
I0416 09:48:45.708089 3672 create_cluster.go:1407] Using SSH public key: /home/ec2-user/.ssh/id_rsa.pub

error reading cluster configuration "cluster.zhy.k8s.local": error reading s3://liuhongxi-kops-cn/cluster.zhy.k8s.local/config: Unable to list AWS regions: NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
SharedCredsLoad: failed to load profile, default.
EC2RoleRequestError: no EC2 instance role found
caused by: EC2MetadataError: failed to make EC2Metadata request
caused by:

<title>404 - Not Found</title>

404 - Not Found

make: *** [create-cluster] Error 1

@liuevan48
Copy link
Author

I fixed this issue, but it become a new issue as below:

[ec2-user@ip-10-0-1-198 kops-cn-master]$ make create-cluster
I0416 10:05:28.663147 4217 create_cluster.go:1407] Using SSH public key: /home/ec2-user/.ssh/id_rsa.pub
I0416 10:05:31.038374 4217 subnets.go:184] Assigned CIDR 10.0.32.0/19 to subnet cn-northwest-1a
I0416 10:05:31.038400 4217 subnets.go:184] Assigned CIDR 10.0.64.0/19 to subnet cn-northwest-1b
I0416 10:05:31.038407 4217 subnets.go:184] Assigned CIDR 10.0.96.0/19 to subnet cn-northwest-1c

error adding SSH public key: error fingerprinting SSH public key "admin": error parsing SSH public key: ssh: no key found

@pahud
Copy link
Contributor

pahud commented Apr 16, 2019

error adding SSH public key: error fingerprinting SSH public key "admin": error parsing SSH public key: ssh: no key found

Your public key file may be broken or does not exist. Make sure your public key file exists and is valid in /home/ec2-user/.ssh/id_rsa.pub

@pahud pahud changed the title Not able to create the cluster error parsing SSH public key: ssh: no key found Apr 16, 2019
@liuevan48
Copy link
Author

It seems if we generate the public key from somewhere else and import to /home/ec2-user/.ssh/, it won't work. But if we generate the public key in EC2 directly by using "ssh-keygen", the key can be used.

@pahud
Copy link
Contributor

pahud commented Apr 16, 2019

yes, you need to generate your ssh keypair by

  1. ssh-keygen
    or
  2. generate from your EC2 keypair console, downloading the .pem private key and use ssh-keygen -f to generate its public key

see this demo

image

image

@pahud
Copy link
Contributor

pahud commented Apr 16, 2019

updated the README doc to help understand how to generate a public key for kops
afa8b7e
44efd9d

@pahud pahud closed this as completed Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants