Hi,
I am trying to add list of remote servers to known_hosts file without prompting for password. I am unable to do as each time I am trying to connect to the remote server it prompts to add the hostkey and once accepted will ask for password.

Input_file :
user1@server1
user2@server2

and my script is some thing like

if [[ -s $Input_file]]
then
set -A SERVERS `cat $Input_file`
for server_name in ${SERVERS[*]}
do
`ssh $server_name`
echo "Server Details : $server_name"
done
else
echo " Input file doesn't exists with the list of remote servers"
fi

1.Can I add all remote servers hostkey without providing the password? I don't want to setup the public,private key.
2.Can I make it automated so that it won't even prompt for yes/no

Thanks in advance.