VACM token in snmpd.conf not recognized

Vincent Gilson via Net-snmp-coders <[email protected]> Mon, 25 Nov 2024 14:39:01 +0000
Newsgroups gmane.network.net-snmp.devel
Message-ID <LO0P123MB63346D0F38B475C90ECA7C3CF12E2@LO0P123MB6334.GBRP123.PROD.OUTLOOK.COM>
--===============2959343718868380993==
Content-Language: fr-FR
Content-Type: multipart/alternative;
	boundary="_000_LO0P123MB63346D0F38B475C90ECA7C3CF12E2LO0P123MB6334GBRP_"

--_000_LO0P123MB63346D0F38B475C90ECA7C3CF12E2LO0P123MB6334GBRP_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hello,

I've implemented my own net-snmp Agent in a Linux embedded system.

While the Agent seems to start correctly, it seems the config file parser i=
s not recognizing the VACM tokens "createUser ", "rwuser", "group", "access=
" and "view" within my snmpd.conf file

Snmpd.log file shows :

9:read_config:line: /var/net-snmp/snmpd.conf:1 examining: createUser vincen=
t
trace: read_config(): read_config.c, 994:
read_config:line: /var/net-snmp/snmpd.conf:1 examining: createUser vincent
/var/net-snmp/snmpd.conf: line 1: Warning: Unknown token: createUser.

I have this snmpd.conf log file :

createUser vincent

#
# Listening connections :
agentAddress dtlsudp:10161
#
# DTLS, TLS and certificates support :
[snmp] tlsAlgorithms DEFAULT
[snmp] localCert tboxvincent

# User access :
view viewallmibs included .1
access grptbox "" any priv exact viewallmibs viewallmibs none
access grptbox_unsec "" any auth exact viewallmibs none none

certSecName 10 2D:27:C4:AC:4D:5B:39:7C:51:99:8A:80:F9:C3:80:F7:D5:3D:64:8E =
--sn vincent
group grptbox tsm vincent
rwuser -s tsm vincent priv -V viewallmibs


And this configure call :

./configure --prefix=3D$(INSTALL_PREFIX) --host=3D$(HOST) \
              --disable-applications --enable-debugging --disable-embedded-=
perl --without-perl-modules \
              --enable-reentrant \
              --with-cc=3D$(CC) --with-linkcc=3D$(CC) --with-ar=3D$(AR) --w=
ith-ldflags=3D"$(LDFLAGS)" --with-cflags=3D"$(CFLAGS_EXT)" \
              --with-openssl=3D$(LIB_DIRS) \
              --without-rpm \
              --with-logfile=3D"/tmp/var/snmpd.log" \
              --with-default-snmp-version=3D"3" \
              --with-transports=3D"UDP,TCP,DTLSUDP,TLSTCP" --with-security-=
modules=3D"usm,tsm" \
              --with-persistent-directory=3D"/var/net-snmp" \
              --enable-shared=3Dyes --enable-static=3Dno --enable-tagCC-lib=
tool


Any ideas ?

Thanks for helping !

Vincent.


--_000_LO0P123MB63346D0F38B475C90ECA7C3CF12E2LO0P123MB6334GBRP_
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40"><head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-ligatures:standardcontextual;
	mso-fareast-language:EN-US;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:11.0pt;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext=3D"edit">
<o:idmap v:ext=3D"edit" data=3D"1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=3D"en-BE" link=3D"#0563C1" vlink=3D"#954F72" style=3D"word-wrap:=
break-word">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><span lang=3D"EN-US">Hello,<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">I=E2=80=99ve implemented my own=
 net-snmp Agent in a Linux embedded system.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">While the Agent seems to start =
correctly, it seems the config file parser is not recognizing the VACM toke=
ns =E2=80=9CcreateUser =E2=80=9C, =E2=80=9Crwuser=E2=80=9D, =E2=80=9Cgroup=E2=
=80=9D, =E2=80=9Caccess=E2=80=9D and =E2=80=9Cview=E2=80=9D within my snmpd=
.conf file<br>
<br>
<u>Snmpd.log file shows :</u><br>
<br>
</span><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-family:&quot;Cou=
rier New&quot;">9:read_config:line: /var/net-snmp/snmpd.conf:1 examining: c=
reateUser vincent<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:&quot;Courier New&quot;">trace: read_config(): read_config.c, 994:<o=
:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:&quot;Courier New&quot;">read_config:line: /var/net-snmp/snmpd.conf:=
1 examining: createUser vincent<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:10.0pt;font-=
family:&quot;Courier New&quot;">/var/net-snmp/snmpd.conf: line 1:
<b>Warning: Unknown token: createUser.<o:p></o:p></b></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><u><span lang=3D"EN-US">I have this snmpd.conf log f=
ile : <o:p>
</o:p></span></u></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">createUser vincent<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"># Listening connections :<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">agentAddress dtlsudp:10161<o:p></o:p></span>=
</p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">#<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"># DTLS, TLS and certificates support :<o:p><=
/o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">[snmp] tlsAlgorithms DEFAULT<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">[snmp] localCert tboxvincent<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"># User access :<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">view viewallmibs included .1<o:p></o:p></spa=
n></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">access grptbox "" any priv exact viewallmibs=
 viewallmibs none<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">access grptbox_unsec "" any auth exact viewa=
llmibs none none<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">certSecName 10 2D:27:C4:AC:4D:5B:39:7C:51:99=
:8A:80:F9:C3:80:F7:D5:3D:64:8E --sn vincent<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">group grptbox tsm vincent<o:p></o:p></span><=
/p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">rwuser -s tsm vincent priv -V viewallmibs<o:=
p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><u><span lang=3D"EN-US">And this configure call :</s=
pan></u><span lang=3D"EN-US"><br>
<br>
</span><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-family:&quot;Cour=
ier New&quot;">./configure --prefix=3D$(INSTALL_PREFIX) --host=3D$(HOST) \<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --disable-applications --enable-debuggin=
g --disable-embedded-perl --without-perl-modules \<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --enable-reentrant \<o:p></o:p></span></=
p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-cc=3D$(CC) --with-linkcc=3D$(CC) =
--with-ar=3D$(AR) --with-ldflags=3D"$(LDFLAGS)" --with-cflags=3D"$(CFLAGS_E=
XT)" \<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-openssl=3D$(LIB_DIRS) \<o:p></o:p=
></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --without-rpm \<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-logfile=3D"/tmp/var/snmpd.log" \<=
o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-default-snmp-version=3D"3" \<o:p>=
</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-transports=3D"UDP,TCP,DTLSUDP,TLS=
TCP" --with-security-modules=3D"usm,tsm" \<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --with-persistent-directory=3D"/var/net-=
snmp" \<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; --enable-shared=3Dyes --enable-static=3D=
no --enable-tagCC-libtool<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US">Any ideas&nbsp;?<br>
<br>
Thanks for helping !<br>
<br>
Vincent.<o:p></o:p></span></p>
<p class=3D"MsoNormal"><span lang=3D"EN-US" style=3D"font-size:9.0pt;font-f=
amily:&quot;Courier New&quot;"><o:p>&nbsp;</o:p></span></p>
</div>


</body></html>=

--_000_LO0P123MB63346D0F38B475C90ECA7C3CF12E2LO0P123MB6334GBRP_--


--===============2959343718868380993==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============2959343718868380993==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

--===============2959343718868380993==--