I'm working on automating a whole environment by using AWS CloudFormation and during the testing period I'm required to kill and re-create the servers very often.
The servers are configured to set their IP addresses from a dedicated pool which means that on the first time I connect to them I have to accept the host key checking (the yes/no question) and then when I delete the server and re-create it, I have to delete the server's key from the known_hosts file each time.
My question is:
Is it possible to delete the key from known_hosts automatically when I close the session? is there such a setting which I've missed?