Ugh, so I've read every SO solution and nothing has worked.
Long story short, apple reformatted my computer and I lost my Private key to ssh into my aws ec2 linux instance. I generated a new key, changed the permissions to 400 and tried to ssh but I'm getting:
Permission denied (publickey).
when i use the -v option I'm seeing:
ssh: Could not resolve hostname [path-to-my-new-pem]: nodename nor servname provided, or not known
any ideas?
when you say that you generated a new key, you still need to import the key pair into the EC2 instance, which obviously you cannot since you lost the current private key. ok so how to move it from there.
You need the key pair to be uploaded into the ~/.ssh/authorized_keys
The procedure is explained in amazon doc Connecting to Your Linux Instance if You Lose Your Private Key
basically you need to:
terminate
as you would loose the current data)--> now you have access to all your data, update the authorized_keys
with the new key pair
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.