Search code examples
sshamazon-ec2ssh-keys

how to connect from one ec2 instance to another ec2 instance through ssh


I have two amazon ec2 instances

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

now i want to install tungsten replicator into my ec2 instances and tungsten replicator needs ssh access from one ec2 instance to another ec2 instance

i tried to check that ssh is 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 following error:

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

i have search on google and tried some trick but none of them worked

sometime i got 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 anyone please tell me how to connect ssh from one ec2 instance to another


Solution

  • I'd suggest you to create a special keypair for the tungsten user.

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

    And then copy both files to the other host in the same place and permissions.

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