I would like to access my new virtual server in the cloud with ssh from an install script so that it does not ask for user interaction. When I use plain
ssh -i keys.pem email@example.com
it does tell me that this is a new host, do I trust it? As I freshly create this, I want to trust it without further ado.
Then I did use
-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no
but this does not establish the connection so that later requests go automatically. It does not create the entry in known_hosts.
How can I make ssh to connect non-interactively first and then all the time?