rpi-imager icon indicating copy to clipboard operation
rpi-imager copied to clipboard

Add option to load SSH keys from GitHub

Open ShellAddicted opened this issue 3 years ago • 4 comments

This PR adds an (advanced) option to automatically load SSH public keys from GitHub removing the extra step of typing https://github.com/<username>.keys in a web browser and copy->pasting the key.

This could be quite useful for the upcoming Network install feature where copy pasting is not even possible.

ShellAddicted avatar Feb 20 '22 20:02 ShellAddicted

Not sure if commenting is frowned upon but...

Nicely done! I just tested your changes on a local branch, and everything seems to work. Tested the compiled version on WIndows 11, Debian, Endevour OS, and a semi-broken Fedora. They all work correctly and open the browser easily. Might as well add a way to login into the imager with Github.

NonstickAtom785 avatar Mar 11 '22 10:03 NonstickAtom785

Not sure if commenting is frowned upon but...

Nicely done! I just tested your changes on a local branch, and everything seems to work. Tested the compiled version on WIndows 11, Debian, Endevour OS, and a semi-broken Fedora. They all work correctly and open the browser easily. Might as well add a way to login into the imager with Github.

Thanks. But what do you mean with "and open the browser easily"?

No browser needs to be opened, that's the point of this PR.

Also, no login is required because as the name implies, public keys are public.

ShellAddicted avatar Mar 11 '22 11:03 ShellAddicted

The imager appears to use cloud-init to set up users and keys, so it should be enough to type "gh:username" as your ssh key. In theory this will be stored in the cloud-init config at /boot/user-data and cloud-init will fetch the key from github during the first boot process. Have you tried this? I would be quite interested to know if it actually works.

ali1234 avatar Sep 04 '22 06:09 ali1234

My bad, you have to use a different key in the config, and it relies on ssh-import-id being installed (it probably is), see: https://cloudinit.readthedocs.io/en/latest/topics/modules.html#ssh-import-id

I still think this would be preferable to fetching the key inside the imaging tool though.

ali1234 avatar Sep 04 '22 07:09 ali1234