Add ssh fingerprint to known_hosts without actually ssh'ing into machine

I am setting up a multi-node hadoop cluster. As a part of this process I need to have all the nodes be able to ssh into each other (this is needed for other parts of the hadoop ecosystem).

I end up having to ssh into each node, then exit, then ssh into the next one, then exit, etc. Then repeat this on each node. Is there a way to do this faster?

Right now I am doing ssh -o StrictHostKeyChecking=no 127.0.0.1 which is better than having to type yes every time, but not ideal.

I'd prefer something like:

[command] localhost
[command] 127.0.0.1
[command] 0.0.0.0

That way I could just throw all the IP's in a script and run the script on every node and save myself a huge chunk of time and tedium.

Any thoughts?

Answers


Quite the trend of answering my own questions -

Here's something that works for me: I found you can pass commands with ssh in the format

ssh $host 'command1; command2; command3'

so I am just passing

ssh $host 'exit'

Need Your Help

Hector integration with CQL

java cassandra hector cql kundera

Will Hector be integrated with CQL in Cassandra 0.8.1? Is anyone actively developing this or know of it? Also, does anyone know of any other Java clients (like Pelops, Hector, Kundera, etc) that are

How to create an XML document from a .NET object?

c# .net xml

I have the following variable that accepts a file name: