I need to generate vagrant images that are configured as master/slave types. The slaves need to have SSH access to the master node, and there will be tens of thousands of slave instances.
Vagrant supplies Puppet and Chef provisioners, so I used Puppet since it is already floating around in the infrastructure so it should be easier to maintain here.
I am performing the following to generate SSH keys on the node that spawns the instances that will become my images like so:
ssh-keygen -t rsa -N "" -f keys/id_rsa_medusa
Unfortunately this seems to be generating SSH keys that still require a password. I am also generating these keys on an Ubuntu host and using puppet to pull them in to the vagrant instances, which does not seem to work.
What is a 1 liner or script I can use that will actually generate an ssh key with an empty passphrase?
This doesnt work,
echo -e '\n \n' | ssh-keygen -t rsa -f keys/id_rsa_medusa
ssh-keygen is creating keys with the base host's identity. Generally you would generate these from the host you are trying to ssh from and ssh-copy-id them over to the host you are trying to connect to. In this scenario, the host ID of the machine generating the keys is neither host. How do you generate generic keys that allow any host to access the server host?
Since this is vagrant (headless puppet) I am unable to copy keys between instances because somehow they both have the same IP address when I log into them. I have attempted to generate keys on the base host, then use the following to convert to PEM format, but it doesnt work either:
ssh-keygen -f keys/id_rsa_medusa -e -m pem > keys/id_rsa_medusa.pem