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

Use user's account for public-key authentication, not the "admin" account

Open bit-bash opened this issue 2 years ago • 2 comments

On our systems, we run as normal users. So, when I start the Imager, it requires admin authentication which is a different user account. To enable SSH public-key authentication, it seems that the Imager is trying to find the admin account's id_rsa.pub instead of the user's own id_rsa.pub file - so typically the field is empty my admin account doesn't have a .ssh directory. It seems more useful to either file the user's .ssh directory or allow the Imager to ask which user's .ssh directory to look for. Of course, I can open the user's id_rsa.pub file in notepad and copy/paste it into the Imager, but this seems cumbersome. Thanks!

bit-bash avatar Jul 21 '23 20:07 bit-bash

The code to copy SSH public keys was written with the Linux and OS X platforms in mind, on which Imager itself runs as normal user, and only opening the raw disk device for writing is outsourced to a more privileged process. May indeed not work correctly on Windows.

maxnet avatar Jul 21 '23 21:07 maxnet

Ahh. Turns out that I can't really use this option for my setup. I was hoping I could use Imager to copy the public-key over to the RPi so I could do ssh/scp without having to always provide a password. But, Imager also changes /sshd_config to prevent the password usage. I kind of want both, so I've modified my setup to run ssh-copy-id to the RPi just once after the RPi is booted.

bit-bash avatar Jul 24 '23 20:07 bit-bash

Closing as stale - the OP found a workaround, and I'm not convinced that allowing both password-authentication and public-key-authentication on a written OS is a sensible move.

tdewey-rpi avatar Sep 18 '24 14:09 tdewey-rpi