Added TODO about public key removal logic.

This commit is contained in:
Stephen Fox 2019-02-05 12:00:01 -05:00
parent f9d24ccda0
commit e40aa515f2
1 changed files with 1 additions and 0 deletions

View File

@ -38,6 +38,7 @@ func (s *StepCleanupTempKeys) Run(_ context.Context, state multistep.StateBag) m
ui.Say("Trying to remove ephemeral keys from authorized_keys files")
// TODO: Why create a backup file if you are going to remove it?
cmd.Command = fmt.Sprintf("sed -i.bak '/ %s$/d' ~/.ssh/authorized_keys; rm ~/.ssh/authorized_keys.bak", s.Comm.SSHTemporaryKeyPairName)
if err := cmd.StartWithUi(comm, ui); err != nil {
log.Printf("Error cleaning up ~/.ssh/authorized_keys; please clean up keys manually: %s", err)