On Thu 14 May 2026 at 23:18:41 (-0400), Stefan Monnier wrote: > (would beat the hell out of > trying to remember which cables are power-only and which aren't).
I use a little red cotton thread as whipping (on power-only cables). > > In an ideal world you plug your device into a USB port and if whatever > > it is connected to wants to do anything other than negotiate charging > > then positive action has to be taken by you. But, software has bugs and > > some people want a second level of defence. > > Not just bugs: I don't know of any OS out there that is even designed to > behave like you describe: they all automatically accept to recognize the > other end as whichever device (or set of devices) it claims to be. My android phone does that, as I already described: "When I run it [the script to mount the phone's fileystem] after connecting the phone, it (phone) asks for permission on its screen [which I have to acknowledge]." (We use the posted scripts for our two "real" phones, not the udev stuff described below.) > To bring this discussion back to Debian: does someone here know of a way > to configure Debian so it asks for explicit confirmation before > accepting new USB devices? Just don't run an automounter? I have a rule in /etc/udev/rules.d/ that looks at the properties of an inserted device and runs an appropriate script. The scripts look for a filename in /etc/udev/rules.d/my-mountpoints/ that matches one of the properties it was handed, and the string in that file is used to create a mountpoint in /media/. /etc/fstab contains entries for all the different mountpoints. Those that require sudo for mounting (like NTFS) have x-sudo in the option list, so that my mount scripts know to do that. It's all simple stuff, and very reliable. (The explicit confirmation is my typing the mount command.) Cheers, David.

