Always operating as root is somewhat taboo (for extremely good reasons) among the Linux and network security communities, and as such most of the time even an embedded Linux computer will need to operate using user accounts that are restricted to only required resources.

For this example, we make a GPIO users group, and give that group permission to access the gpio resource without the need to have full system authority.


We'll start with a relatively stock TS-7800-V2 (though this should work fine on most newer computers, say the TS-4900, or the TS-7970).  Log in as root and do these:


Add this line to /etc/udev/rules.d/96-gpio.rules:

SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c 'find -L /sys/class/gpio/ -maxdepth 2 -exec chown root:gpio {} \; -exec chmod 770 {} \; || true'"

Running these commands will create a new user and add them to the gpio group:

groupadd gpio
useradd notroot
usermod -g gpio notroot
reboot

Now log back in as notroot, now with full access to GPIO