Skip to content
This repository was archived by the owner on Feb 20, 2025. It is now read-only.
This repository was archived by the owner on Feb 20, 2025. It is now read-only.

find_yubikey() fails with "Access denied (insufficient permissions)", even as root #7

Description

@jacobian
$ sudo python -c 'import yubico; yubico.find_yubikey()'
Password:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/yubico/yubikey.py", line 229, in find_key
    YK = YubiKeyUSBHID(debug=debug, skip=skip)
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/yubico/yubikey_usb_hid.py", line 141, in __init__
    if not self._open(skip):
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/yubico/yubikey_usb_hid.py", line 441, in _open
    self._usb_handle.claimInterface(self._usb_int)
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/usb/legacy.py", line 230, in claimInterface
    util.claim_interface(self.dev, if_num)
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/usb/util.py", line 191, in claim_interface
    device._ctx.managed_claim_interface(device, interface)
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/usb/core.py", line 112, in managed_claim_interface
    self.backend.claim_interface(self.handle, i)
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/usb/backend/libusb1.py", line 758, in claim_interface
    _check(self.lib.libusb_claim_interface(dev_handle.handle, intf))
  File "/Users/jacob/.virtualenvs/hkyubi/lib/python2.7/site-packages/usb/backend/libusb1.py", line 571, in _check
    raise USBError(_str_error[ret], ret, _libusb_errno[ret])
usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

This is on OS X 10.9 ("Mavericks"), which I believe is important (I've found a few issues related to libusb on 10.9 that sound similar)

I'm running libusb-1.0.18 installed from Homebrew, PyUSB 1.0.0b1 installed from PyPI, and python-yubico 1.2. also installed from PyPI.

Activity

  1. dainnilsson commented on Mar 4, 2014

    @dainnilsson
    Member

    This is a known issue with libusb on OSX: http://www.libusb.org/ticket/89
    Until this is fixed I don't think there is anything we can do about it, unfortunately.

  2. josepvalls commented on Jan 9, 2016

    @josepvalls

    Any idea on how to implement a workaround using HIDAPI as suggested in the linked thread? Doesn't look like the devs will fix it.

  3. fhibler commented on Feb 12, 2016

    @fhibler

    As the "Yubikey Personalization Tool" is working on OSX, there must be some kind of workaround. Any chance this python module gets adapted accordingly?

    Or someone is able to have a look into HIDAPI, as suggested in the thread posted above?

    Thanks!

  4. dainnilsson commented on Feb 12, 2016

    @dainnilsson
    Member

    YubiKey Personalization Tool doesn't use libusb on OSX, and thus is not affected by this issue. Adding a HIDAPI backend using https://pypi.python.org/pypi/hidapi is probably doable, but would require some effort. Contributions in this area are welcome!

  5. zestysoft commented on Oct 24, 2020

    @zestysoft

    Updating this with a current link to why this still doesn't work (www.libusb.org doesn't respond for me):
    pyusb/pyusb#208

    Has there been an attempt to use this library instead?
    https://github.com/libusb/libusb
    Or does it need to have a BSD license?

    Is there another programming language that has better MacOS support from Yubico?

  6. bsaund commented on Apr 28, 2021

    @bsaund

    I also get the same usb.core.USBError: [Errno 13] Access denied (insufficient permissions) on Ubuntu 20.04 when calling find_yubikey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions