Alok Menghrajani
Previously: security engineer at Square, co-author of HackLang, put the 's' in https at Facebook. Maker of CTFs.
This blog does not use any tracking cookies and does not serve any ads. Enjoy your anonymity; I have no idea who you are, where you came from, and where you are headed to. Let's dream of an Internet from times past.
Home | Contact me | Github | RSS feed | Consulting services | Tools & games
How can you cheaply control the ports on a usb hub?
On a build server, we wanted to sign various builds using Yubikeys. For various reasons, we wanted to use several Yubikeys. Unfortunately, simply plugging multiple Yubikeys on a single host doesn't work because there's no API to pick which token you want to communicate with.
There are various ways to solve this problem, such as buying expensive USB hubs. I however figured out that some cheap D-Link hubs let you control the power at the individual port level.
This technique is also useful when you need to copy a file to a hundred USB flash drives.
Some useful source code: https://github.com/alokmenghrajani/hub-ctrl.c