Blame README.snmpv3

Packit Service b38f0b
README.snmpv3
Packit Service b38f0b
-------------
Packit Service b38f0b
How to setup SNMPv3, a very brief document for Dave to elaborate and
Packit Service b38f0b
do a better job on since I suck at writing documentation and he
Packit Service b38f0b
doesn't ;-) --Wes:
Packit Service b38f0b
Packit Service b38f0b
Note: SHA authentication and DES/AES encryption support is only available
Packit Service b38f0b
if you have OpenSSL installed or if you've compiled using
Packit Service b38f0b
--with-openssl=internal.  If you use --with-openssl=internal please
Packit Service b38f0b
read the documentation in snmplib/openssl/README for important details.
Packit Service b38f0b
Packit Service b38f0b
Note: encryption support now *is* enabled in the binary releases downloadable
Packit Service b38f0b
from the net-snmp web site.
Packit Service b38f0b
Packit Service b38f0b
Note: this description assumes you're using the software compiled from
Packit Service b38f0b
source, and so installed using the default prefix location (/usr/local).
Packit Service b38f0b
If you're working with a vendor-provided system, or have configured
Packit Service b38f0b
things with a different prefix, you'll need to adjust locations accordingly.
Packit Service b38f0b
Packit Service b38f0b
CREATING THE FIRST USER:
Packit Service b38f0b
------------------------
Packit Service b38f0b
  First, you need to create a new snmpv3 user and give them rights to
Packit Service b38f0b
  do things:
Packit Service b38f0b
Packit Service b38f0b
    net-snmp-config --create-snmpv3-user -a "my_password" myuser
Packit Service b38f0b
Packit Service b38f0b
  WARNING: SNMPv3 pass phrases must be at least 8 characters long!
Packit Service b38f0b
Packit Service b38f0b
  The above line creates the user "myuser" with a password of
Packit Service b38f0b
  "my_password" (and uses MD5 and DES for protection).  (Note that
Packit Service b38f0b
  encryption support isn't enabled in the binary releases downloadable
Packit Service b38f0b
  from the net-snmp web site.)  net-snmp-config will also add a line
Packit Service b38f0b
  to your snmpd.conf file to let that user have read/write access to
Packit Service b38f0b
  your agent.  You may want to change this in your snmpd.conf file
Packit Service b38f0b
  (see the snmpd.conf manual page).  Run net-snmp-config --help for
Packit Service b38f0b
  more information about it.
Packit Service b38f0b
Packit Service b38f0b
  Start the agent and test your setup:
Packit Service b38f0b
    /usr/local/sbin/snmpd
Packit Service b38f0b
       [...wait a few seconds...  It will run in the background and
Packit Service b38f0b
        return you to your shell immediately.]
Packit Service b38f0b
Packit Service b38f0b
    snmpget -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost sysUpTime.0
Packit Service b38f0b
       [ this should return information about how long your agent has been up]
Packit Service b38f0b
  
Packit Service b38f0b
    snmpget -v 3 -u myuser -l authPriv   -a MD5 -A my_password
Packit Service b38f0b
                                         -x DES -X my_password localhost sysUpTime.0
Packit Service b38f0b
       [ this should return similar information, but encrypts the transmission ]
Packit Service b38f0b
Packit Service b38f0b
CREATING A SECOND USER:
Packit Service b38f0b
-----------------------
Packit Service b38f0b
  Start the agent (if you didn't do so above).
Packit Service b38f0b
Packit Service b38f0b
  You can create as many users as you like using the above method, but
Packit Service b38f0b
  this details another way of doing it while the agent is running by
Packit Service b38f0b
  modifying the user database using the snmp protocol itself:
Packit Service b38f0b
Packit Service b38f0b
  Now, lets create a second user using the first user (just for fun)
Packit Service b38f0b
  for both authentication purposes and as a template (or "cloning
Packit Service b38f0b
  source"):
Packit Service b38f0b
Packit Service b38f0b
    snmpusm -v 3 -u myuser -l authNoPriv -a MD5 -A my_password localhost create wes myuser
Packit Service b38f0b
Packit Service b38f0b
  The above should have created the user "wes" with the same password as
Packit Service b38f0b
  the "myuser" user.  So then, you need to change his password using:
Packit Service b38f0b
Packit Service b38f0b
    snmpusm -v 3 -u wes -l authNoPriv -a MD5 -A my_password localhost passwd my_password new_passphrase
Packit Service b38f0b
Packit Service b38f0b
  See, wasn't that easy?  You can now create users.  Wheeee....
Packit Service b38f0b
Packit Service b38f0b
  But, you'll have to add a configuration line that allows them access
Packit Service b38f0b
  to do things.  Do this with another "rwuser" line in your
Packit Service b38f0b
  /usr/local/share/snmp/snmpd.conf file (you'll need to stop and start 
Packit Service b38f0b
  the agent again, or send the agent a SIGHUP signal):
Packit Service b38f0b
Packit Service b38f0b
    rwuser wes
Packit Service b38f0b
Packit Service b38f0b
  Or, optional use the "rouser" token instead of the "rwuser" token to
Packit Service b38f0b
  only grant them read-only access.
Packit Service b38f0b
Packit Service b38f0b
  Now, test your new user:
Packit Service b38f0b
Packit Service b38f0b
    snmpget -v 3 -u wes -l authNoPriv -a MD5 -A new_passphrase localhost sysUpTime.0
Packit Service b38f0b
Packit Service b38f0b
Packit Service b38f0b
FURTHER STUDIES:
Packit Service b38f0b
---------------
Packit Service b38f0b
Packit Service b38f0b
Tired of all those command line authentication options?
Packit Service b38f0b
----------------------------------------
Packit Service b38f0b
put something like this in your $HOME/.snmp/snmp.conf file (make it
Packit Service b38f0b
readable only by you!!!):
Packit Service b38f0b
Packit Service b38f0b
  defSecurityName wes
Packit Service b38f0b
  defContext ""
Packit Service b38f0b
  defAuthType MD5
Packit Service b38f0b
  defSecurityLevel authNoPriv
Packit Service b38f0b
  defAuthPassphrase new_passphrase
Packit Service b38f0b
  defVersion 3
Packit Service b38f0b
Packit Service b38f0b
And this is in place the last of the above example lines boils down to:
Packit Service b38f0b
Packit Service b38f0b
  snmpget localhost sysUpTime.0
Packit Service b38f0b
Packit Service b38f0b
Which is about as simple as I can make it for ya ;-)