I'm running into problems some scripts extending snmp, which needs priviliges granted to one of the groups the user 'snmp' is in. However, it appears snmp 'drops' those group for some reason:
#!/bin/bash
id
Run from commandline as snmp:
# su - snmp
$ ./script.sh
Results in:
uid=108(snmp) gid=111(snmp) groups=111(snmp),103(othergroup)
But after restarting the snmp deamon, and running running snmpwalk from another server, the id returns something wholly different:
...."extrastats".2 = STRING: uid=108(snmp) gid=0(root) groups=111(snmp),0(root)
It seems that while snmpd is started with it's -u <snmp-user-id>, the related groups aren't used, only the primary. How can I get it to do this / get all of snmp's groups? Supplying just 1 of the extra groups with -g is a workaround for half the priviliges for now, but I'd rather have snmpd running as all needed groups if possible...