Comments (8)
What actual permissions does an account using ykush actually need? It works for me with sudo, but I prefer not to run scripts over the web with root level access, even using suid approaches. It would be far better to use a privelege separation approach, but for that I would need to know what groups/permissions to define for the user running the ykush script. (user of the web-server)
from ykush.
I revisited this issue some time ago. I suggest you look into writing a udev rule for when a ykush device is plugged into you ubuntu machine which adds the device to a group that has permission to access it. You can then add your user to that group and you should not require privileges to access the device anymore.
You can create the group using:
groupadd ykushdev
Here is an example rules file (it should work for your case):
# /etc/udev/rules.d/99-ykush.rules
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="f2f7", MODE="0664", GROUP="ykushdev"
This file should have 644 permissions which would keep any non-root user from changing them allowing for arbitrary code execution with the PROGRAM and RUN keywords. You can change the permissions using:
chmod 644 /etc/udev/rules.d/99-ykush.rules
Then add yourself to the ykushdev group using:
usermod -a -G ykushdev <your username>
Reload the rules file:
udevadm control --reload
Finally, log out and in again to let the addition of the user account to the ykushdev group take effect.
Setting this up will require sudo permissions, however, once it is set up you should not require privileges anymore to access any ykush device plugged into the ubuntu machine.
Let me know if that works for you.
from ykush.
Hi, can you please send the output of lsusb
command with the board connected.
Thanks
from ykush.
This is the output of lsusb
Bus 001 Device 015: ID 2b3e:ace2
Bus 001 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 014: ID 2b3e:ace2
Bus 001 Device 013: ID 2b3e:ace2
Bus 001 Device 012: ID 2b3e:ace2
Bus 001 Device 011: ID 2b3e:ace2
Bus 001 Device 010: ID 2b3e:ace2
Bus 001 Device 009: ID 2b3e:ace2
Bus 001 Device 002: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 001 Device 008: ID 2b3e:ace2
Bus 001 Device 007: ID 2b3e:ace2
Bus 001 Device 006: ID 2b3e:ace2
Bus 001 Device 005: ID 2b3e:ace2
Bus 001 Device 004: ID 2b3e:ace2
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 008: ID 04d8:f2f7 Microchip Technology, Inc.
Bus 002 Device 007: ID 04d8:f2f7 Microchip Technology, Inc.
Bus 002 Device 006: ID 04d8:f2f7 Microchip Technology, Inc.
Bus 002 Device 005: ID 04d8:f2f7 Microchip Technology, Inc.
Bus 002 Device 004: ID 0e0f:0008 VMware, Inc.
Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub
Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
from ykush.
I have this issue also (Ubuntu 16.04). Sudo corrects the issue but I am trying to use this from a process without sudo access.
$ ykushcmd -l
Attached YKUSH Boards
YKUSH device found with Serial Number: (null)
Manufacturer: (null)
Product: (null)
$ sudo ykushcmd -l
Attached YKUSH Boards
YKUSH device found with Serial Number: XXXXXX
Manufacturer: Yepkit Lda.
Product: YKUSH
$ykushcmd ykushxs -l
Attached YKUSH XS Boards:
(null)
$ sudo ykushcmd ykushxs -l
Attached YKUSH XS Boards:
XXXXXX
from ykush.
Did anyone figure out what to do to run without sudo? I had this issue but I made something and it was working but right now we are setting up a new Ubuntu machine and there is again the same issue.
from ykush.
That worked for me. Thanks Franz! I used the command “groupadd” with no space and I deleted the “productId” portion of the rule.
from ykush.
Great news. Glad I could help. I will edit my previous comment to correct that mistake. Thank you.
from ykush.
Related Issues (20)
- sudo inside install.sh HOT 1
- Fails to detect YKUSH3 hub HOT 5
- ykush xs device disappears HOT 4
- there is no need to use #!/bin/bash in scripts
- Arch Linux package HOT 1
- segfault with ykush3 boards HOT 1
- [minor] Typo in embedded help HOT 2
- can't reset the second board!
- [minor] Typo in manpages.ubuntu.com
- Firmware update. HOT 1
- "Unable to write to device" - Port switching fails under Linux HOT 3
- Seg fault on trying to list board HOT 3
- ykush downstream ports led is not glow HOT 2
- How can i upload firmware to ykush xs
- Unable to build ykushcmd control application on ubuntu 20.04
- Could not control downstream port in mac HOT 2
- turning on single port results in all port turned on
- ykushcmd -s YKxxxx -u 2 order of options shouldn't matter
- FW version reported is 1.0.0 after flashing 1.5.0 HOT 1
- Device identify differently on Ubuntu 20 and U22
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ykush.