rpi-imager
rpi-imager copied to clipboard
Use better UI for adding authorized_keys
I started using rpi-imager not too long ago.
As I rarely do setup of ssh servers, I don't know what the proper contents of the authorized keys field should look like in rpi-imager. Currently, the field is only a single line text input which is quite short. It is not clear to me, which parts of my newly generated public ssh public key (ssh-keygen on linux commandline) I need to paste into that field. The input field should assist me by indicating whether the pasted string looks like a valid public key.
Also, it should be capable of accepting multiple public keys, e.g. when a friend gives me his public key so I can give that person access too while setting up a new raspi installation.
So the input field should also offer a way of adding multiple ssh keys one after the other and also giving me an indication about how many valid keys I already entered. So when I would see a label like "2 valid keys entered", I would immediately see that the setup seems to be correct in that case.
See also #326 and #316
As I rarely do setup of ssh servers, I don't know what the proper contents of the authorized keys field should look like in rpi-imager.
If you are using Linux or Mac OS X it will automatically fill in the contents of ~/.ssh/id_rsa.pub and you do not have to copy it manually. Perhaps we should look into doing the same for Windows, but more complicated there as we are not running under normal username but as admin, and user may not be using the official ssh client -which Windows does ship nowadays- but something third-party like Putty...
I was actually using Linux in that situation. There was nothing I noticed that was telling me the rpi-imager would automatically pick up the id_rsa.pub. I also don't think that this is a good idea because I want to actively decide which keys should be allowed on the raspi and no magic happen in the background that would violate privacy or integrity of the key/the raspberry install without the user actively giving permission to add a certain key to the raspberry
There was nothing I noticed that was telling me the rpi-imager would automatically pick up the id_rsa.pub.
It will pre-fill the contents of ssh key box, but you will still need to check the "enable ssh" -> "allow public key only" boxes before it has any effect... Up to you to remove your own key in that case, if you like to only give your neighbour access to your Pi and not yourself... Just like it pre-fills the username that you are logged in as on the computer running Imager, but it will only be used if you click "Set username and password", and you are welcome to change it... Same with wifi...
If you did not notice it filled something in, then you probably did not generate a key with normal OpenSSH command-line tools ("ssh-keygen"), but are using something non-standard (e.g. Putty). (Or have saved Imager settings previously, before the key existed. If saved settings are used, they are pre-filled instead of information from your system)