Search code examples
snmpnet-snmp

Remove User in snmp by agent


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.


Solution

  • In my understandings, the net-snmp-create-v3-user would simply do the following:

    service stop snmpd
    $EDITOR  /var/lib/net-snmp/snmpd.conf
    [add *usmUser* lines]
    $EDITOR  /etc/snmp/snmpd.conf
    [add *rouser* and *rwuser* lines]
    service start snmpd
    

    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:

    service stop snmpd
    $EDITOR  /var/lib/net-snmp/snmpd.conf
    [find and remove *usmUser* info]
    $EDITOR  /etc/snmp/snmpd.conf
    [find and remove *rouser* and *rwuser* info]
    service start snmpd
    

    Rather than printable characters, the usmUser fields are expressed as hex strings. They are simply not encrypted.