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 user@host.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?

  • Gergely
link|improve this question
feedback

1 Answer

up vote 1 down vote accepted

Have you tried just using the following?

$ ssh -o StrictHostKeyChecking=no -i keys.pem user@host.com

I don't see the point of having -o UserKnownHostsFile=/dev/null as well; this just seems to prevent the addition of the key to your known hosts file.

link|improve this answer
2  
Also, BatchMode=yes would be a good addition. – Janne Pikkarainen Jun 9 '11 at 9:54
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.