[BB-1913] Delete SSH key upon terminating the AppServer
Created by: Agrendalath
This PR is a follow-up to #495. It removes SSH key from ~/.ssh/known_hosts
before we terminate the sever. This way we won't encounter SSH key conflict when we get the server with the same IP we've used before.
Testing instructions.
- Log into stage.
- Create new AppServer for any existing instance.
- Log to stage via SSH and switch to the proper user.
- Run
ssh-keygen -F $IP
to check that the key has been added to~/.ssh/known_hosts
. If the response is empty, try again in a minute. - Use
Terminate
button in Ocim. - Run
ssh-keygen -F $IP
to confirm that the key has been deleted.
Note: integration tests are failing, but they're not related to this change.