Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import SSH keys from existing account #158

Open
glingy opened this issue Nov 10, 2024 · 1 comment
Open

Import SSH keys from existing account #158

glingy opened this issue Nov 10, 2024 · 1 comment

Comments

@glingy
Copy link

glingy commented Nov 10, 2024

GitHub provides a nice public API for pulling a user's public keys https://docs.github.com/en/rest/users/keys?apiVersion=2022-11-28#list-public-keys-for-a-user, and the Ubuntu installer allows you to import keys by default: https://jasonmurray.org/posts/2020/ubuntuautosshkey/.

Evidently GitLab has the same: https://docs.github.com/en/rest/users/keys?apiVersion=2022-11-28#list-public-keys-for-a-user which incidentally uses a compatible response schema.

https://api.github.com/users/glingy/keys
https://gitlab.com/api/v4/users/glingy/keys

Would it be feasible to add the ability to import keys from a GitHub or gitlab account to easily import several keys quickly into pico.sh?

@neurosnap
Copy link
Member

neurosnap commented Nov 12, 2024

Greetings! We do have an API for syncing authorized_keys. This file is bidirectional, meaning you can download and upload and we will diff and patch your authorized pubkeys on the pico platform.

It's not quite a one-liner but this should work:

curl https://github.com/glingy.keys > ./authorized_keys
scp ./authorized_keys pico.sh:/

https://pico.sh/faq#authorized-keys-file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants