Ask Your Question
0

how to ssh in Openstack to 2 instances by same Key-Pair

asked 2017-11-02 16:05:58 -0500

Kave gravatar image

I Create one key-pair and assigned it to 2 instances. But only I can ssh to the first instance. Can I use of the same key-pair for ssh logging on 2 instances from my ubuntu? I mean I want to log on the from one Ubuntu machine.

edit retag flag offensive close merge delete

4 answers

Sort by ยป oldest newest most voted
0

answered 2017-11-05 04:54:04 -0500

martbhell b gravatar image

Turn on ssh agent forwarding. I prefer it over copying the private key around.

Use

ssh -A user@ip

edit flag offensive delete link more
0

answered 2017-11-04 08:00:13 -0500

mlschuler gravatar image

If all instances are in the same private network the default security group allows any traffic. You must, however, copy the private ssh key to all the instances and store them in .ssh/id_rsa. Then ssh should work between the instances, too.

edit flag offensive delete link more
0

answered 2017-11-04 06:30:59 -0500

Kave gravatar image

updated 2017-11-04 06:32:42 -0500

Yes, I can use. I think its better to more describe my problem. I have 3 instances on my own OpenStack cloud user. I can log on them out of the cloud by the same key which I added in OpenStack. Now I need to test my instances by MPI and it is needed to all instances can OpenSSH without a password but I can not ssh between instances even by password but I checked my ping between them which were okay and ssh port also was open and can be found in the error after ssh even by password. I mean my main problem is that I can not ssh between instances in OpenStack.

ubuntu@blue:~$ ssh ubuntu@192.168.2.5

The authenticity of host '192.168.2.5 (192.168.2.5)' can't be established. ECDSA key fingerprint is SHA256:8ZRA14NqZlRi1bf6S26XajQnoeHyGnzAjaQWuuwDZg8. Are you sure you want to continue connecting (yes/no)? yes

Warning: Permanently added '192.168.2.5' (ECDSA) to the list of known hosts. Permission denied (publickey).

edit flag offensive delete link more

Comments

1

Three possibilities: The instance didn't receive the public key. Use the instance console to check that. Or it has a different keypair than you think. Or your private key in ~/.ssh is not correct.

Bernd Bausch gravatar imageBernd Bausch ( 2017-11-05 07:22:33 -0500 )edit
1

answered 2017-11-03 23:23:59 -0500

Yes, you can log on to several instances using the same key pair. Just use the same private key to log on.

Do you get an error message when you try?

Perhaps the second instance didn't get the public key? Use the console to check if it has been installed.

edit flag offensive delete link more

Comments

ubuntu@blue:~$ ssh ubuntu@192.168.2.5

The authenticity of host '192.168.2.5 (192.168.2.5)' can't be established. ECDSA key fingerprint is SHA256:8ZRA14NqZlRi1bf6S26XajQnoeHyGnzAjaQWuuwDZg8. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.2.5' (ECDSA) t

Kave gravatar imageKave ( 2017-11-04 06:31:39 -0500 )edit

You only have 255 characters for writing a comment.

Bernd Bausch gravatar imageBernd Bausch ( 2017-11-08 07:10:52 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

Stats

Asked: 2017-11-02 16:05:58 -0500

Seen: 461 times

Last updated: Nov 05 '17