Score:0

Remote access to `/dev/input` fails with permission error

es flag
zlg

I need to open a USB game controller device (joystick) remotely. This device is physically connected to server and is available for local user with permissions:

crw-rw-r--+ 1 root input 13, 0 ** /dev/input/js0

Using sshfs on client side, I mounted remote /dev/input/ on a local folder /dev/input/remote/:

sudo sshfs -o allow_other server-usr@server_ip:/dev/input /dev/input/remote

Now, I can see the device in mounted folder on client:

crw-rw-r-- 1 root netdev 0, 0 ** /dev/input/remote/js0

However, programs on client side (like jstest) fail to open/use device with Permission Denied error!

How can I find access to remote Joystick on the client without permission issues?

MORE: users on both sides are added to FUSE and NETDEV groups. Also, I have added line user_allow_other to /etc/fuse.conf which is required for allow_other argument in SSHFS command. Changing chmod for the device to 777 didn't help as well. No success.

A.B avatar
cl flag
A.B
I doubt that sshfs will "forward" ioctl() made on devices, because SFTP certainly wouldn't have an command called IOCTL in its API. It's working on filesystems, not char devices. See also https://cateee.net/lkddb/web-lkddb/CUSE.html , https://superuser.com/questions/209884/where-are-programs-that-use-cuse-character-in-user-space
A.B avatar
cl flag
A.B
This would give you better success: https://www.kernel.org/doc/html/latest/usb/usbip_protocol.html
zlg avatar
es flag
zlg
@A.B Thanks, I tried `usbip`, it works on older kernels which my machine doesn't support. I installed it via `linux-tools-generic` and followed the instruction here: https://developer.ridgerun.com/wiki/index.php?title=How_to_setup_and_use_USB/IP, my client fails to find and mount `usbip` and `vhci-hcd` modules using `sudo modprobe`. I also tried `socat`+`ser2net` to pipe traffic. However, joystick does not work as normal `UART` device and traffic from pipe is not decoded correctly.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.