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.
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'