0

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.

zlg
  • 1
  • 1
  • 1
    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 Jul 05 '21 at 16:58
  • 1
    This would give you better success: https://www.kernel.org/doc/html/latest/usb/usbip_protocol.html – A.B Jul 05 '21 at 17:04
  • @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. – zlg Jul 05 '21 at 17:11

0 Answers0