zhaojing
zhaojing

Reputation: 635

net-snmp security name too long: what is the max length of security name

I am configuring net-snmp. Below is my snmpd.conf:

 #com2sec NAME SOURCE COMMUNITY
    com2sec sec_localuser_localhost 127.0.0.1 localuser
    com2sec sec_testuser_tests.sse.hin.hellomi.com 127.0.0.1 testuser
    #group NAME MODEL SECURITY
    group grp1 v2c sec_localuser_localhost
    group testgroup v2c sec_testuser_tests.sse.hin.hellomi.com
    #view NAME      TYPE      SUBTREE [MASK]
    view all included .iso
    view iso included .all
    #access NAME CONTEXT MODEL LEVEL PREFX READ WRITE NOTIFY
    access grp1 ""  any noauth exact all - all
    access testgroup ""  any noauth exact all all all

in the log of messages, I could find the following error:

snmpd.conf: line 6: Error: security name too long

So it means the hostname: tests.sse.hin.hellomi.com is too long

My question is: What is the maximum length for the security name? I tried from google, but I found nothing about the maximum length.

Anyway, I know I can test to find the maximum length, but I just wonder if there is any formal limit on the maximum length.

Thanks!

Upvotes: 1

Views: 2200

Answers (2)

Robert
Robert

Reputation: 51

The limit is the same as an SnmpAdmingString, 32 characters.

Upvotes: 3

JPBlanc
JPBlanc

Reputation: 72660

SECNAME is an internal security identifier it identify a SNMP communauty (you are using localuser it's generaly public or private) comming from a computer (127.0.0.1) so why do you want to map it to a computername.

If you absolutly want to know the limit length, Net-SNMP is open source, so you can grep the error message into the sources.

Upvotes: 3

Related Questions