Skip to content

Instantly share code, notes, and snippets.

@displague
Created July 8, 2020 22:51
Show Gist options
  • Save displague/0a92496ecb4e8750b327edb20a621730 to your computer and use it in GitHub Desktop.
Save displague/0a92496ecb4e8750b327edb20a621730 to your computer and use it in GitHub Desktop.
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