Published in


How to add a new SSH key in AWS EC2?

Credits: treewebdesign.weebly

Requirement story:
Assume your colleague doesn’t have the same SSH key which is used to connect the AWS EC2 machine. However, she has her own SSH key in her machine.

She is asking you to help in her situation.


Get into EC2 by simple ssh

ssh -i "/path/to/sshkey.pem" ubuntu@ec2-1-1-1-1.us-east-2.compute.amazonaws.com

Once you are in, just check whether key available in the machine:

cat ~/.ssh/authorized_keys

You might see some keys are available in the authorized keys like below:

ssh-rsa ...Iv abc

Regardless the previous key available or not, you just add your colleague’s SSH key in the authorized_keys


Ask your friend to verify from her machine to AWS EC2 by using her existing SSH key.




Microprediction/Analytics for Everyone! We help volunteers to do analytics/prediction on any data!

Recommended from Medium

Announcing Goa v3

via Tumblr http://bit.ly/2k4YFYo

Case Study of Ansible

Loki to the Rescue!

Umbraco 8 ~ Introduction

Umbraco 8 Logo


Graphql integration tests with apollo-server-testing, jest-mongodb and nock

The Demanding “Technology Stacks” in 2021 — MEAN / MERN

“Technology Stacks” in 2021 — MEAN / MERN

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Raja CSP Raman

Raja CSP Raman

Researcher / Mentor

More from Medium

Deploy Containerized Flask app to Heroku

Deploy your app on AWS free

Serving up an Image Using AWS CloudFront and S3

Creating Flask Restful “CRUD” mock Youtube API with Python