Created
July 8, 2020 22:51
-
-
Save displague/0a92496ecb4e8750b327edb20a621730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import packet | |
import json | |
import os | |
from pathlib import Path | |
label="[email protected]" | |
manager = packet.Manager(auth_token=os.environ["APIKEY"]) | |
#manager.get_ssh_key("4405413a-8da6-4e56-9c4f-07e532d7a024").delete() | |
keys = manager.list_ssh_keys() | |
for k in [k for k in keys if k.label == label]: | |
k.delete() | |
manager.create_ssh_key( | |
label=label, | |
public_key=Path("/Users/marques/.ssh/id_rsa.pub").read_text(), | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment