How do I change the key pair for my ec2 instance in AWS management console? I can stop the instance, I can create new key pair, but I don't see any link to modify the instance's key pair.
相关问题
- How to generate 12 digit unique number in redshift
- Use awslogs with kubernetes 'natively'
- JQ: Select when attribute value exists in a bash a
- JavaScript File Transfer SSH
- Assume/switch role in aws toolkit for eclipse 2.0
相关文章
- Check if directory exists on remote machine with s
- Right way to deploy Rails + Puma + Postgres app to
- how many objects are returned by aws s3api list-ob
- AWS S3 in rails - how to set the s3_signature_vers
- Passthrough input to output in AWS Step Functions
- Git Clone Fails: Server Certificate Verification F
- I cannot locate production log files on Elastic Be
- ImportError: cannot import name 'joblib' f
I went through this approach, and after some time, was able to make it work. The lack of actual commands made it tough, but I figured it out. HOWEVER - much easier approach was found and tested shortly after:
Run this command after you download your AWS pem.
Then dump the output into
authorized_keys
.Or copy pem file to your AWS instance and execute following commands
and then
I have tried below steps and it worked without stopping the instance. My requirement was - as I have changed my client machine, the old .pem file was not allowing me to log in to the ec2 instance.
You will see your old keys in that file.
ssh-keygen -f YOUR_PEM_FILE.pem -y It will generate a key. Append the key to ~/.ssh/authorized_keys opened in step#1. No need to delete the old key.
From AWS console, create a new key pair. Store it in your new machine. Rename it to the old pem file - reason is old pem file is still associated with the ec2 instance in AWS.
All done.
I am able to log in to the AWS ec2 from my new client machine.
In case you are using ElasticBeanstalk platform, you can change the keys by going:
This will terminate current instance and creates new one with chosen keys/settings.
I believe the simpliest aproach is to :
The simplest solution is to copy the contents of
into your AWS instance's authorized_keys at
This will allow you to ssh into the EC2 instance without specifying a pem file for the ssh command. You can remove all other keys once you've tested connecting to it.
If you need to create a new key to share it with someone else, you can do that with:
which will create the private key.pem file, and you can get the public key of that with:
Anyone who has private_key.pem will be able to connect with