Commit ac397f08 authored by Daniel Stan's avatar Daniel Stan

[ssh_key] better quickly delete private temp key

parent 654a7f74
...@@ -716,20 +716,18 @@ def show_file(options): ...@@ -716,20 +716,18 @@ def show_file(options):
key_file.write(texte.encode('utf-8')) key_file.write(texte.encode('utf-8'))
key_file.flush() key_file.flush()
pub = subprocess.check_output(['ssh-keygen', '-y', '-f',]) pub = subprocess.check_output(['ssh-keygen', '-y', '-f',])
# Charge en mémoire # Charge en mémoire
subprocess.check_call(['ssh-add',]) subprocess.check_call(['ssh-add',])
# On attend # On attend (hors tmpfile)
print(shown.encode('utf-8')) print(shown.encode('utf-8'))
raw_input() raw_input()
with tempfile.NamedTemporaryFile(suffix='') as pub_file:
# On met la clé publique en fichier pour suppression
# On met la clé publique en fichier puis on supprime subprocess.check_call(['ssh-add', '-d',])
subprocess.check_call(['ssh-add', '-d',])
else: else:
# Le binaire à utiliser # Le binaire à utiliser
showbin = "cat" if is_hidden else "less" showbin = "cat" if is_hidden else "less"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment