Creating a new Raspberry Pi/ Raspbian User with GPIO Access

Creating a new user in Raspbian, or any Linux distribution, is simple, just use the commands below:

sudo adduser <username>
sudo adduser <username> gpio

If you fail to add the user to the “gpio” group you will get the following Python error when trying to perform GPIO-related tasks:

No access to /dev/mem. Try running as root!

If you want the user to be a “Super User” i.e. have access to run commands with root privileges via sudo (see here for more info), add the user to the “sudo” group as well:

sudo adduser <username> sudo