Configure usb port rule by wizzard

Post here if you are a new Porteus member and you're looking for some help.
Post Reply
Borisko
White ninja
White ninja
Posts: 6
Joined: 15 Oct 2017, 04:58
Distribution: Study

Configure usb port rule by wizzard

Post#1 by Borisko » 15 Oct 2017, 07:02

Hi, I want to use Porteus distro for the educational project for which I will need to use flash drives to be inserted into public PC.
I have to configure at least one specified usb port by usb device type to allow it for usb flash drives insertion only. So that it should block any usb device except usb flash drive (no keyboard, no mouse, nothing superfluous except flash drive).
Is it possible to configure usb port with Porteus wizzard or should I configure udev manually for this purpose as well for others Linux destros?
Last edited by Borisko on 16 Oct 2017, 00:38, edited 1 time in total.

User avatar
fanthom
Site Admin
Site Admin
Posts: 4617
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Configure usb port rule by wizzard

Post#2 by fanthom » 15 Oct 2017, 17:30

Hi Borisko,

Is this query related to Kiosk? If yes then you need to remaster installation ISO and you could add your rule to 003-settings.xzm/sbin/udev-automount-disabled script (scan dmesg and check for specific vendor/product id before mounting). Then enable support for removable devices in the wizard.

Thanks
Please add [Solved] to your thread title if the solution was found.

Borisko
White ninja
White ninja
Posts: 6
Joined: 15 Oct 2017, 04:58
Distribution: Study

Configure usb port rule by wizzard

Post#3 by Borisko » 16 Oct 2017, 00:59

Thank you very much!

Yes, this is related to kiosk for my class at university.
Just need a little bit more help with the rule setting :D
This rule should work for one specified usb port and should not allow access to any devices except usb flash drive (usb device type recognition).

So, first I start this command udevadm monitor --property in terminal and then I'm watching ID_TYPE and ID_USB_DRIVER params (is for usb device type, am I right?) during the usb flash drive insertion.

I found some matches in my case:
ID_TYPE=disk
ID_USB_DRIVER=usb-storage

After that I create new file /etc/udev/rules.d/96-myusb.rules with the rule ACTION=="add", SUBSYSTEM=="usb",ENV{ID_TYPE}=="disk", ENV{ID_USB_DRIVER}=="usb-storage",RUN+=""

Is it correct?

Now I have device type designation only. Could somebody help me with the RUN commad, please? I stuck at this moment. How to create disable/unmount command for designated usb device?
Any advice will be appreciated. Sorry for my language :pardon:

Borisko
White ninja
White ninja
Posts: 6
Joined: 15 Oct 2017, 04:58
Distribution: Study

Configure usb port rule by wizzard

Post#4 by Borisko » 20 Oct 2017, 06:52

I just watched this video and saw some interesting options in wizard settings.
Could somebody describe the functionality of these options, please?
It seems that this is what I need!

Image

Image

So, relying on these options all what I have to do is enable removable device option and enable (as default) input devices, am I right?
But there are 2 questions:
1) Does the input devices option work for inserted devices only or it checks all devices beginning with booting proccess? So if I enable it can I use for e.g. touchscreen monitor with usb interface (required for a full service kiosk)?
2) If I enable removable device will this option allow to use mouse, keyboard e.t.c? Or flash drives only?

Thank you.

Post Reply