Tauno
Tauno

Reputation: 197

SSH connection to EC2 instance fails

I'm trying to create the SSH connection to EC2 instance but getting the error message that the keypair file does not exist.

AWS Management Console confirms that the keypair file exists: enter image description here

Making connection to EC2 instance is fine but its seems that there aren't any files: enter image description here

AWS Management Console confirms that the right command to set permissions is:

chmod 400 tauno537_aws_keypair.pem

enter image description here

When trying to execute this, it gives the following error message:

chmod: cannot access ‘tauno537_aws_keypair.pem’: No such file or directory

When trying to create the SSH connection to EC2 instance, it gives the following error message:

ssh [email protected] -i tauno537_aws_keypair.pem
Warning: Identity file tauno537_aws_keypair.pem not accessible: No such file or directory.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

What I have done wrong? Is it correct that when...

  1. Making connection to EC2 instance (PuTTY login), the private key needs to be used?
  2. Creating SSH connection, the public key needs to be used?

What's the diference between PuTTY login and SSH connection at all? Doesn't they both mean that making the connection to the EC2 instance?

Upvotes: 0

Views: 1079

Answers (1)

Sathyajith Bhat
Sathyajith Bhat

Reputation: 21851

Both your errors point to the fact that the private key file is not found in the directory where you're running from/pointing the private key to

Putty is just a SSH/Telnet client, so ultimately you are using a SSH connection. When a keypair is created, the private key remains clientside and the public key is uploaded to the server

Upvotes: 1

Related Questions