I'm using AWS Linux (which is a Centos variant). I've used SNMP before. I'm trying to change the community name from public
to something1234
(for example). I'm using the standard netsnmp package that one gets by running sudo yum install snmp
.
My test to see if snmp giving me access control or not is to use snmpwalk. If this works, the community is public or is being ignored:
snmpwalk -v 1 localhost -c public .1.3.6
If that gives no output but this works, I'm golden:
snmpwalk -v 1 localhost -c something1234 .1.3.6
I have yet to be golden.
The distribution creates the file /etc/snmp/snmpd.conf
.
The top of the file has this:
# First, map the community name "public" into a "security name"
# sec.name source community
com2sec notConfigUser default public
I've tried changing public
in that line to something1234
but that doens't help. I've also tried adding this to the end of the file:
view systemview included .1.3.6.1.2
view systemview included .1.3.6.1.4
rocommunity something1234 localhost
That doesn't work either.
I've tried running snmpconf
which is supposed to create and modify SNMP configuration files. It deletes my file /etc/snmp/snmpd.conf
and creates a new file /usr/share/snmp/snmpd.conf
which has a lot less information ... and which also doesn't work for something1234
.
So how do I change the RO community to something1234
?
My snmpd.conf for recent versions of snmpd look like this. Where the community would be
hunter
.For snmpwalk you might need to use a command like this.