Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Do expired SSH keys get deleted?

I added an SSH key with a ttl of 60 seconds with this command:

 

gcloud compute os-login ssh-keys add --key-file ~/.ssh/id_rsa.pub --ttl 60s

 

 
I expected after after expiration, the SSH key would be deleted. After the expiration, the key is still listed in the output of gcloud compute os-login ssh-keys list.
 
Do expired os-login SSH keys get periodically deleted?
 
For more background: I am creating and SSHing into temporary GCP instances for automated tests. I want to delete expired SSH keys to avoid the error Login profile size exceeds 32 KiB. Delete profile values to make additional space. described here: https://github.com/kyma-project/test-infra/issues/93.
 
Sincerely,
Kevin
Solved Solved
0 1 2,579
1 ACCEPTED SOLUTION

I may have spoken too soon. After waiting a day, the key no longer appears in `gcloud compute os-login ssh-keys list`.

I am still curious when SSH keys are expected to be deleted, but this resolves my issue.

View solution in original post