how to make amazon EC2 instances authenticate each other automatically?

Sami

I am using aws java sdk to launch EC2 instances (running Ubuntu 12.04) and run a distributed tool on them, the tool uses openMPI for message passing between the nodes and openMPI uses SSH to connect nodes with each other.

The problem is that the EC2 instances don't authenticate each other for SSH connections by default, this tutorial shows how to set up SSH by generating keys and adding them to nodes, However, when I tried to add the generated key to the slaves using the command

$ scp /home/mpiuser/.ssh/id_dsa.pub mpiuser@slave1:.ssh/authorized_keys

I still got permission denied. Also, after generating new keys, I was not able to log in using the ".pem" key that I got from amazon.

I am not experienced with SSH keys, but I would like to have some way of configuring each EC2 instance (when its firstly created) to authenticate the others, for example by coping a key into each of them. Is this possible and how It could be done?

P.S.: I can connect to each instance once it is launched and can execute any commands on them over SSH.

Sami

I found the solution, I added the amazon private key (.pem) in the image (AMI) that I use to create the EC2 instances and I changed the /etc/ssh/ssh_config file by adding a new identity file

IdentityFile /path/to/the/key/file

This made SSH recognize the .pem private key when it tries to connect to any other EC2 instance created with the same key.

I also changed StrictHostKeyChecking to no, which stopped the message "authenticity of host xxx can't be established" which requires users interaction to proceed with connecting to that host.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Make an Amazon EC2 instance ask for sudoing password

분류에서Dev

How to "connect" objects in 2 classes to make them update each other?

분류에서Dev

How to install a GUI on Amazon AWS EC2

분류에서Dev

How to view website launched in Amazon EC2 instance?

분류에서Dev

how to create multiple ports for apache on amazon EC2?

분류에서Dev

How to access and mount Amazon public dataset to EC2

분류에서Dev

How to make 2 interfaces (of 2 different linux server) reachable to each other?

분류에서Dev

how to make widgets float over each other in flutter

분류에서Dev

How EC2 instances don't require password for sudo for Ubuntu user but 'include' is commented?

분류에서Dev

How can I find a Ubuntu package to use with Amazon EC2?

분류에서Dev

How to SFTP into Amazon EC2 Ubuntu t1.micro instance?

분류에서Dev

How do I change the resolution of an Amazon EC2 Windows Machine?

분류에서Dev

make object follow each other

분류에서Dev

How to automatically maintain a list of class instances?

분류에서Dev

Amazon WS EC2 대안

분류에서Dev

Amazon Cloud EC2 비용

분류에서Dev

ncftpget on amazon ec2 not working (centos)

분류에서Dev

Amazon EC2의 VPN

분류에서Dev

How to make WiFi work automatically?

분류에서Dev

How do I make two ubuntu computers communicate with each other by controlling their wireless cards?

분류에서Dev

Is there an easy way to connect to EC2 instances using their Name tag?

분류에서Dev

ansible ec2 running list needs to be a list of instances

분류에서Dev

How to place 2 spans beside each other with full width with CSS

분류에서Dev

Amazon EC2 인스턴스 손실

분류에서Dev

Amazon ec2 Linux AMI에 tuleap 설치

분류에서Dev

Amazon EC2 서버의 SIP 서버

분류에서Dev

Curl Amazon EC2 인스턴스

분류에서Dev

Amazon EC2의 불완전한 ResultSet

분류에서Dev

Amazon EC2에 Pygtk 설치

Related 관련 기사

  1. 1

    Make an Amazon EC2 instance ask for sudoing password

  2. 2

    How to "connect" objects in 2 classes to make them update each other?

  3. 3

    How to install a GUI on Amazon AWS EC2

  4. 4

    How to view website launched in Amazon EC2 instance?

  5. 5

    how to create multiple ports for apache on amazon EC2?

  6. 6

    How to access and mount Amazon public dataset to EC2

  7. 7

    How to make 2 interfaces (of 2 different linux server) reachable to each other?

  8. 8

    how to make widgets float over each other in flutter

  9. 9

    How EC2 instances don't require password for sudo for Ubuntu user but 'include' is commented?

  10. 10

    How can I find a Ubuntu package to use with Amazon EC2?

  11. 11

    How to SFTP into Amazon EC2 Ubuntu t1.micro instance?

  12. 12

    How do I change the resolution of an Amazon EC2 Windows Machine?

  13. 13

    make object follow each other

  14. 14

    How to automatically maintain a list of class instances?

  15. 15

    Amazon WS EC2 대안

  16. 16

    Amazon Cloud EC2 비용

  17. 17

    ncftpget on amazon ec2 not working (centos)

  18. 18

    Amazon EC2의 VPN

  19. 19

    How to make WiFi work automatically?

  20. 20

    How do I make two ubuntu computers communicate with each other by controlling their wireless cards?

  21. 21

    Is there an easy way to connect to EC2 instances using their Name tag?

  22. 22

    ansible ec2 running list needs to be a list of instances

  23. 23

    How to place 2 spans beside each other with full width with CSS

  24. 24

    Amazon EC2 인스턴스 손실

  25. 25

    Amazon ec2 Linux AMI에 tuleap 설치

  26. 26

    Amazon EC2 서버의 SIP 서버

  27. 27

    Curl Amazon EC2 인스턴스

  28. 28

    Amazon EC2의 불완전한 ResultSet

  29. 29

    Amazon EC2에 Pygtk 설치

뜨겁다태그

보관