LOGBOOK

HELP

Quiz Entry - updated: 2026.11.10

OpenOCD is started from a root shell (sudo bash) because it cannot open the FT232H otherwise. Why does that happen, and what is the better fix?

Linux creates USB device nodes that only root may write to, and OpenOCD needs raw write access to the adapter. A udev rule that grants that access to normal users for the FT232H's VID:PID is the better fix, so that OpenOCD runs without root privileges.

A serial bridge like the CP2102N gets a ready-made driver and a /dev/ttyUSB0 node that users in the dialout group can open. The FT232H in JTAG mode is different: OpenOCD talks to the chip directly through libusb, using the raw device node under /dev/bus/usb/…. By default, only root may write to that node, so a normal user gets an error saying it cannot open the device or that access was denied.

Starting the program as root works, but it is a poor habit for a security course:

  • OpenOCD then runs with full control of the machine. It loads script files and opens network ports (3333 for GDB, 4444 for telnet, 6666 for Tcl). A bug or a malicious script would run as root.
  • Files it writes are owned by root and later cause permission problems for the normal user.
  • sudo bash also starts a shell without the ESP-IDF environment, which has to be activated again inside it.

The clean solution is a udev rule. udev is the Linux service that creates device nodes when hardware is plugged in, and a rule can match the FT232H by idVendor=0403 and idProduct=6014 and set group permissions on its node. OpenOCD ships such a rules file (60-openocd.rules). Copy it to /etc/udev/rules.d/, reload the rules, add the user to the group the rule names, and replug the adapter. After that OpenOCD runs as a normal user.

Go deeper:

From Quiz: SIOT / JTAG Debugging with OpenOCD and GDB | Updated: Nov 10, 2026