How to connect from one ec2 instance to another ec2 instance via ssh

I have two instances of ecazon ec2

I can connect to this ec2 instance from my windows using putty (public key generated from the private key provided by amazon)

now I want to install a tungsten replicator in my ec2 instances and the tungsten replicator needs ssh access from one ec2 instance to another ec2 instance.

I tried to verify that ssh was working or not from one ec2 instance to another I tried:

ssh ec2-user@public ip of destination instance //also tried ssh ec2-user@private ip destination instance 

but its not working

I got the following error:

 Permission denied (publickey,gssapi-keyex,gssapi-with-mic) 

I have a google search and tried some trick, but none of them worked

I once received the following error:

 Address public_ip maps to xxxx.eu-west-1.compute.amazonaws.com, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT! 

can anybody tell me how to connect ssh from one ec2 instance to another

+7
ssh ssh-keys amazon-ec2
source share
2 answers

I suggest you create a special key pair for a tungsten user.

 cd tungsten-user-home/.ssh ssh-keygen -t rsa mv id-rsa.pub authorized-keys 

And then copy both files to another host at the same location and permissions.

This will allow tungsten to work without requiring its own key.

+4
source share

Just like when you need ssh from your local machine to an EC2 instance, you need to provide the ssh command to the proper pem file:

 ssh -i my_pem_file.pem ec2-user@private-or-public-ip-or-dns 
+1
source share

All Articles