I want to write a
udev rule that blocks access to USB storage. I want to add match options that can recognise the username and permit only some users to use USB storage.
How can I find out which user(s) a currently logged in?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.Sign up to join this community
Why do you think you need such a complicated approach which also will cause trouble in any multi-user scenario? Why detect user logons?
I think you should simply write a
udev rule which changes device access rights (group and its permissions) for the USB subsystem, and maintain access via the group memebrship of users. This is a standard case for