Skip to content

[BB-1913] Delete SSH key upon terminating the AppServer

Boros Gábor requested to merge agrendalath/bb-1913-remove_ssh_keys into master

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.

  1. Log into stage.
  2. Create new AppServer for any existing instance.
  3. Log to stage via SSH and switch to the proper user.
  4. 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.
  5. Use Terminate button in Ocim.
  6. 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.

Merge request reports