Sergiu Poenaru
Sergiu Poenaru

Reputation: 149

Adding a new user to my AWS EC2, need to learn about .pub/.pem keys

I'm trying to add a new user to a single EC2 instance, instead of giving access via IAM to the entire infrastructure.

Here's what I did so far:

ssh-keygen -b 1024 -f NewUser -t dsa
mkdir .ssh
chmod 700 .ssh
cat NewUser.pub >> .ssh/authorized_keys
chmod 600 .ssh/authorized_keys
chown NewUser .ssh
chown NewUser .ssh/authorized_keys

Great, now I'm trying to login myself to make sure it works before I pass the key to my colleague, however my SSH terminal asks me for a .PEM key (the private one). How do I download the private key? Placing the .pub obviously doesn't work.

Upvotes: 0

Views: 55

Answers (1)

300D7309EF17
300D7309EF17

Reputation: 24573

The private key is called NewUser. It exists in the same folder as where you created NewUser.pub

Here's some basic information on ssh keys from GitHub. You can search for more.

Upvotes: 1

Related Questions