Good evening!
I am having trouble understanding what to add to my /etc/devfs.rules in order to allow a jail to access USB devices. It is about a Raspberry Pi 3B+ running FreeBSD 13.0p4 RELEASE, I would like to set up a jail that runs comms/dump1090, which takes input data from a SDR-RTL USB stick.
On the host system, it works flawlessly as intended.
I added the following custom rule to /etc/devfs.rules:
And edited /etc/jail.conf accordingly:
Even tough I can see the USB device from within the jail, I cannot make use of it:
I guess it's the 1.5, as giving
So I am wondering what is my /etc/devfs.rules file missing, as if I add a new permissive rule such as:
And apply the new rule to the jail, I can run the program normally as I would do from the host. What is missing in my ruleset? How can I find out what I need to "unhide" in the future if I am to attempt something similar with another device?
Thanks
I am having trouble understanding what to add to my /etc/devfs.rules in order to allow a jail to access USB devices. It is about a Raspberry Pi 3B+ running FreeBSD 13.0p4 RELEASE, I would like to set up a jail that runs comms/dump1090, which takes input data from a SDR-RTL USB stick.
On the host system, it works flawlessly as intended.
I added the following custom rule to /etc/devfs.rules:
Code:
# Local jail config
[devfsrules_allow_usb=8]
add include $devfsrules_hide_all
add include $devfsrules_unhide_basic
add include $devfsrules_unhide_login
add include $devfsrules_jail
add path 'usbctl' unhide
add path 'usb/*' unhide
add path 'usb/*' mode 0666
And edited /etc/jail.conf accordingly:
Code:
ads-b {
jid = "2";
allow.mount;
mount.devfs;
enforce_statfs = 0;
devfs_ruleset = "8";
ip4 = inherit;
}
Even tough I can see the USB device from within the jail, I cannot make use of it:
Code:
root@ads-b:/ # ls /dev/usb
1.1.0 1.1.1 1.2.0 1.2.1 1.3.0 1.3.1 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1
root@ads-b:/ # dump1090
No supported RTLSDR devices found.
root@ads-b:/ # usbconfig
No device match or lack of permissions.
I guess it's the 1.5, as giving
usbconfig
from the host outputs:
Code:
ugen1.5: <Realtek RTL2838UHIDIR> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
So I am wondering what is my /etc/devfs.rules file missing, as if I add a new permissive rule such as:
Code:
# Insecure permissive rule, for test only
[devfsrules_allow_all=9]
add path '*' unhide
And apply the new rule to the jail, I can run the program normally as I would do from the host. What is missing in my ruleset? How can I find out what I need to "unhide" in the future if I am to attempt something similar with another device?
Thanks