简体   繁体   中英

With net-snmp 5.8, when using special characters (&,^,$) for encryption key and authentication key, a swnpwalk remote call fails

I am running the following call from windows command line using snmpwalk.

snmpwalk -v 3 -a SHA -A 2OzqVwOQNZcImYBdI9Tfu9HcXFACVB7 
-x AES -X HfkFHRPpyDnGmdRSpI2X4b3ayGYVyeO -l authPriv 
-u sha_aes_DmSc7KCE2ggU 192.168.2.226 iso.3.6.1.2.1

Host 192.168.2.226 is a linux server. The user was created previously by running the following command in a ssh remote session:

sudo net-snmp-config --create-snmpv3-user -ro -a SHA 
-A 2OzqVwOQNZcImYBdI9Tfu9HcXFACVB7 -x AES 
-X HfkFHRPpyDnGmdRSpI2X4b3ayGYVyeO sha_aes_DmSc7KCE2ggU

The call worked fine in the previous case.

The problem came when the -A or -X parameter contained the special character ^. In any of those cases I got the following message:

snmpwalk: Authentication failure (incorrect password, community or key)

I tried escaping ^ character by using ^^ from windows command line, but It still failed.

Then I ran the snmpwalk call in the context of a ssh session (instead of calling remotelly from Windows console), and the call worked fine.

I would expect the call to work exactly in the same way. Anyone knows what I might be missing?

对于 Windows,特殊符号 [^] 需要用双引号括起来,例如:

snmpwalk -v2c -c 123abc"^"666 1.1.1.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM