How long does the one-time use SSH public key expire?

0

I'm interested in the recent feature https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html .

The doc says there is a one-time use SSH public key that only remains 60 seconds.

But I tried it by self, looks like the one-time SSH public key always is valid after pushing it via cli. I can still use the corresponding private key to login the instance after pushing public key more than 10 minutes.

Is it expected behavior? How should I understand the one-time use SSH public key mentioned in doc?

zxkane
gefragt vor 5 Jahren659 Aufrufe
1 Antwort
0
Akzeptierte Antwort

I turned it out. EC2 instance connect works as expected to create one-time SSH public key for 60 times.

The behavior I observed caused by ssh-agent cached another key of ec2 instance.

mengxin
beantwortet vor 5 Jahren
profile picture
EXPERTE
überprüft vor einem Monat

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen