raspberrypi / usbboot

Raspberry Pi USB booting code, moved from tools repository
Apache License 2.0
905 stars 229 forks source link

Allow members of plugdev group to execute rpiboot without root #27

Closed maxnet closed 4 years ago

maxnet commented 6 years ago

It would be nice if it was possible to execute rpiboot without root privileges.

To be able to talk to the device it's only necessary that the user has write permissions on the right /dev/bus/usb device node. Give members of plugdev group access by udev rules. As suggested by @ali1234 in https://github.com/raspberrypi/usbbootgui/issues/3

ali1234 commented 6 years ago

For reference, I suggested plugdev because this is the group you need to be in to use avrdude with USB programmers under Debian. It seems appropriate, but you could invent your own group for this if you wanted.

maxnet commented 6 years ago

It's also used for other removable stuff like phones, cameras and storage. And pi user is a member of it by default, so fits the bill.

simonvanderveldt commented 6 years ago

@ghollingworth Is there anything that needs to be done before this can be merged? Would be nice to get it in, both because of the vulnerability and to make it easier/more secure without sudo.

ghollingworth commented 6 years ago

@maxnet You happy with this in it's current state?

maxnet commented 6 years ago

Am happy with it.

Be aware it has only been tested under Linux though, and not under MacOS and such. Not sure how permissions work with that, and wheter or not a different message than "Make sure you are member of plugdev group" should be printed there. Or if user always has permission, and that is not an issue. Leave that up to you.

malnvenshorn commented 4 years ago

I think the preferred way would be to use the uaccess tag.

zpfvo commented 4 years ago

Why wasn't this merged for so long? #44 is absolutely right.