Bash script to create rsa key pair

Hello all,
I am setting up a cluster of Mac Pro's which need to be able to talk to a master computer, traffic between the nodes and the master needs to take place without a ssh key. I need a script that will create a security key, save it to the default place, enter the password as no password. Something like this:

System Preferences
Sharing
Enable Remote Login

In the Terminal:

ssh-keygen
"Enter YES"
ENTER
ENTER
(for blank password)
cat ~/.ssh/id_rsa.pub | ssh user@remotehost 'cat >> ~/.ssh/authorized_keys'

There are over 50 mac pro's so doing this manually would be tedious.

If anyone knows how to do this, that would be excellent.
Thanks!

You can feed text into ssh-keygen with a here-document:

ssh-keygen <<EOF
line1
line2
line3
EOF

You can substitute variables inside it as you like.

Note that the last EOF must be at the beginning of the line, don't even indent it.

ssh-keygen -f /some/$user/.ssh/user1-id_rsa -t rsa -N '' -q

is what I have been using.

user1-id_rsa can be whatever you need it to be.

or see http://www.bournetoraiseshell.com/article.php/20110907141224250

HTH