通过代理删除 snmp 中的用户
我可以快速完成 snmp 安装并且工作正常。
在代理模块之一中,我目前正在研究并尝试修改源代码。我遇到了一个问题,我需要通过代理删除用户。
坚持完成这个:
就像 net-snmp-create-v3-user
在服务器端创建用户的方式一样,我想知道是否有类似的东西可以删除用户。
I could quickly go through the snmp installation and it works fine.
In one of the agent modules I am currently looking into and trying to modify the source. I came across an issue where I need to remove the user by the agent.
Stuck with to complete this:
Just like the way net-snmp-create-v3-user
creates an user at server side I was wondering if there is something similar to remove the user.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据我的理解,
net-snmp-create-v3-user
只需执行以下操作:在 中添加新用户数据之前,应停止 snmpd。 conf 文件。
相当于
net-snmp-create-v3-user
,删除用户的操作类似:usmUser 字段不是可打印字符,而是表示为十六进制字符串。它们根本就没有加密。
In my understandings, the
net-snmp-create-v3-user
would simply do the following:The snmpd should be stopped before adding new user data in the .conf files.
Equivalent to
net-snmp-create-v3-user
, removing an user would be something similar:Rather than printable characters, the usmUser fields are expressed as hex strings. They are simply not encrypted.
我刚刚遇到了类似的问题。我已经添加了一个用户,想再次删除它。但是,net-snmp 从 /var/net-snmp/snmpd.conf 文件中删除 安全原因,因此 Ashwin kumar 的答案对我不起作用(*参见下面的编辑)。
snmpusm
有一个delete
选项,可用于删除用户。snmpusm
需要另一个用户验证delete
请求(我没有测试过,但我假设其他用户必须具有 RW 访问权限)。以下示例使我能够从我的 snmp 配置中删除用户:此解决方案的灵感来自此页面 http://www.mkssoftware.com/docs/man1/snmpusm.1.asp 其中还描述了如何创建用户并更改用户的密码
snmpusm
。编辑:我的错,我没有注意到 /var/net-snmp/snmpd.conf 实际上包含的行数比 vim 在不滚动的情况下显示的行数还要多。 Ashwin 提到的“usmUser”行就在那里。我没有尝试删除这些行,但我认为这也可以。
I just had a similar issue. I had added an user, and wanted to delete it again. However, net-snmp removes the
createUser
statements from the /var/net-snmp/snmpd.conf file for security reasons, thus Ashwin kumar's answer did not work for me (* see EDIT below).snmpusm
has adelete
option, which can be used to remove users.snmpusm
requires another user to authenticate thedelete
request (I haven't tested without, but I would assume that the other user has to have RW access). The following example has enabled me to remove a user from my snmp configuration:This solution is inspired by this page http://www.mkssoftware.com/docs/man1/snmpusm.1.asp which also describes how to create a user and change the Passphrase of a user with
snmpusm
.EDIT: My bad, I didn't notice that the /var/net-snmp/snmpd.conf actually contained more lines than what vim displayed without scrolling. The "usmUser" lines that Ashwin mentions are there. I haven't tried to remove the lines, but I assume that would work as well.