Giter VIP home page Giter VIP logo

Comments (8)

treii28 avatar treii28 commented on July 19, 2024 2

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.

FranzHeubach avatar FranzHeubach commented on July 19, 2024 1

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.

yep1 avatar yep1 commented on July 19, 2024

Hi, can you please send the output of lsusb command with the board connected.

Thanks

from ykush.

FranzHeubach avatar FranzHeubach commented on July 19, 2024

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.

labtoast avatar labtoast commented on July 19, 2024

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.

jacekkowalczyk82 avatar jacekkowalczyk82 commented on July 19, 2024

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.

labtoast avatar labtoast commented on July 19, 2024

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.

FranzHeubach avatar FranzHeubach commented on July 19, 2024

Great news. Glad I could help. I will edit my previous comment to correct that mistake. Thank you.

from ykush.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.