Granting I2C Device Permissions Using Group i2c

The original method for graning I2C device permissions relied on group i2c. This method may still be required in unusual situations such as a system that use eudev instead of udev.

Depenging on your distribution, package ddcutil should depend on package i2c-tools, in which case most of the work has already been done. As normally packaged, installing package i2c-tools creates group i2c (if it does not alreay exist), and assigns that group to the /dev/i2c devices using a udev rule.

All that is necessary is to add ddcutil users to group i2c:

$ sudo usermod <user-name> -aG i2c

If group i2c does not already exist, the following command will create it:

$ sudo groupadd --system i2c

If not already done by another rules file, you need a udev rules file that assigns the /dev/i2c devices to group i2c. Create file /etc/udev/rules.d/45-myi2c.rules with the following contents:

SUBSYSTEM=="i2c-dev", KERNEL=="i2c-[0-9]*", GROUP="i2c"

Then add userids to group i2c as above.

For testing, it may be simpler to give everyone permission to write to /dev/i2c-* for the current boot:

$ sudo chmod a+rw /dev/i2c-*