3 ms·
> ssh-import-I'd gh:my-gh-name That little command will pull down your GitHub public keys and add them to authorized key file for the user who runs it. Great f
by matt_wulfeck 10y ago
> ssh-import-I'd gh:my-gh-name
That little command will pull down your GitHub public keys and add them to authorized key file for the user who runs it. Great for setting up new computers. I run it on boot-time for imbedded devices so that I can always access them.
- kingosticks 10y agoI didn't know about this, looks really useful, thanks. I wonder if there are any plans to add other protocols e.g. Keybase. Edit. Seems they are way ahead of me: https://github.com/dustinkirkland/ssh-import-id/blob/master/README.md#extending https://github.com/dustinkirkland/ssh-import-id/blob/master/...
- lucideer 10y agoThat's cool, but it seems like a lot of code to do something that: - You can do in one line of bash: curl https://github.com/user.keys https://github.com/user.keys >> ~/.ssh/authorized_keys - The bash one-liner is transparent and educational: it tells you clearly and intuitively where the keys are coming from and where they're going, educating users about the existence of the Github/Gitlab-published keys and about how the authorized_keys file works You seem to require a lot of code, and lose a lot of very real advantages, for the sake of a bit of brevity. What are the other advantages of this tool?
- koolba 10y agoExecuting the curl command with no error checking and blindly appending it to your ~/.ssh/authorized_keys could easily bork the latter. Wrapping it in a fancy command allows for error checking and response validation. Otherwise you could end up the source of https://github.com/503.html https://github.com/503.html in there!
- lucideer 10y agoPerhaps, but the simplicity of the curl command provides enough insight into exactly what it does to understand what precisely it does and what could go wrong. I can see what file it's writing to, I can check that file, I can be pretty sure it's not doing anything else weird behind the scenes.
- koolba 10y agoThat's the whole point. You have to manually do those things. It's not that you can't do them, it's that if you tell someone "Just run curl ... >> ..." without the validation part they can get hosed. Even in a script you need to be careful about it because a non-200 HTTP response still gives a zero (i.e. success) exit status.
- matt_wulfeck 10y agoAgreed! But the program manages your keys. For example, it will remove them if you remove them from GitHub.