libsnmp-dev: Cannot create snmpv3 user with net-snmp-config command

Bug #1322431 reported by Sascha Lucas on 2014-05-23
86
This bug affects 17 people
Affects Status Importance Assigned to Milestone
net-snmp (Debian)
Fix Released
Unknown
net-snmp (Ubuntu)
Medium
Unassigned
Trusty
Medium
Brian Murray
Vivid
Medium
Unassigned

Bug Description

# net-snmp-config --create-snmpv3-user
/usr/bin/net-snmp-config: 236: /usr/bin/net-snmp-config: net-snmp-create-v3-user: not found

reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726158

$ cat /tmp/apport.libsnmp-dev.0klis68z.apport
ProblemType: Bug
ApportVersion: 2.14.1-0ubuntu3.2
Architecture: amd64
Date: Fri May 23 08:55:48 2014
Dependencies:
 adduser 3.113+nmu3ubuntu3
 apt-utils 1.0.1ubuntu2
 base-passwd 3.5.33
 binutils 2.24-5ubuntu3
 busybox-initramfs 1:1.21.0-1ubuntu1
 coreutils 8.21-1ubuntu5
 cpio 2.11+dfsg-1ubuntu1
 cpp 4:4.8.2-1ubuntu6
 cpp-4.8 4.8.2-19ubuntu1
 dbus 1.6.18-0ubuntu4
 debconf 1.5.51ubuntu2
 debconf-i18n 1.5.51ubuntu2
 debianutils 4.4
 dpkg 1.17.5ubuntu5.2
 e2fslibs 1.42.9-3ubuntu1
 e2fsprogs 1.42.9-3ubuntu1
 findutils 4.4.2-7
 gcc 4:4.8.2-1ubuntu6
 gcc-4.8 4.8.2-19ubuntu1
 gcc-4.8-base 4.8.2-19ubuntu1
 gcc-4.9-base 4.9-20140406-0ubuntu1
 ifupdown 0.7.47.2ubuntu4.1
 initramfs-tools 0.103ubuntu4.1
 initramfs-tools-bin 0.103ubuntu4.1
 initscripts 2.88dsf-41ubuntu6
 insserv 1.14.0-5ubuntu2
 iproute2 3.12.0-2
 isc-dhcp-client 4.2.4-7ubuntu12
 isc-dhcp-common 4.2.4-7ubuntu12
 klibc-utils 2.0.3-0ubuntu1
 kmod 15-0ubuntu6
 libacl1 2.2.52-1
 libapparmor1 2.8.95~2430-0ubuntu5
 libapt-inst1.5 1.0.1ubuntu2
 libapt-pkg4.12 1.0.1ubuntu2
 libasan0 4.8.2-19ubuntu1
 libatm1 1:2.5.1-1.5
 libatomic1 4.8.2-19ubuntu1
 libattr1 1:2.4.47-1ubuntu1
 libaudit-common 1:2.3.2-2ubuntu1
 libaudit1 1:2.3.2-2ubuntu1
 libblkid1 2.20.1-5.1ubuntu20
 libbz2-1.0 1.0.6-5
 libc-dev-bin 2.19-0ubuntu6
 libc6 2.19-0ubuntu6
 libc6-dev 2.19-0ubuntu6
 libcap2 1:2.24-0ubuntu2
 libcgmanager0 0.24-0ubuntu6
 libcloog-isl4 0.18.2-1
 libcomerr2 1.42.9-3ubuntu1
 libdb5.3 5.3.28-3ubuntu3
 libdbus-1-3 1.6.18-0ubuntu4
 libdebconfclient0 0.187ubuntu1
 libdrm2 2.4.52-1
 libexpat1 2.1.0-4ubuntu1
 libgcc-4.8-dev 4.8.2-19ubuntu1
 libgcc1 1:4.9-20140406-0ubuntu1
 libgmp10 2:5.1.3+dfsg-1ubuntu1
 libgomp1 4.8.2-19ubuntu1
 libgpm2 1.20.4-6.1
 libisl10 0.12.2-1
 libitm1 4.8.2-19ubuntu1
 libjson-c2 0.11-3ubuntu1
 libjson0 0.11-3ubuntu1
 libklibc 2.0.3-0ubuntu1
 libkmod2 15-0ubuntu6
 liblocale-gettext-perl 1.05-7build3
 liblzma5 5.1.1alpha+20120614-2ubuntu2
 libmount1 2.20.1-5.1ubuntu20
 libmpc3 1.0.1-1ubuntu1
 libmpfr4 3.1.2-1
 libncurses5 5.9+20140118-1ubuntu1
 libncursesw5 5.9+20140118-1ubuntu1
 libnih-dbus1 1.0.3-4ubuntu25
 libnih1 1.0.3-4ubuntu25
 libpam-modules 1.1.8-1ubuntu2
 libpam-modules-bin 1.1.8-1ubuntu2
 libpam-runtime 1.1.8-1ubuntu2
 libpam-systemd 204-5ubuntu20.2
 libpam0g 1.1.8-1ubuntu2
 libpcre3 1:8.31-2ubuntu2
 libperl5.18 5.18.2-2ubuntu1
 libplymouth2 0.8.8-0ubuntu17
 libpng12-0 1.2.50-1ubuntu2
 libprocps3 1:3.3.9-1ubuntu2
 libquadmath0 4.8.2-19ubuntu1
 libselinux1 2.2.2-1ubuntu0.1
 libsemanage-common 2.2-1
 libsemanage1 2.2-1
 libsensors4 1:3.3.4-2ubuntu1
 libsensors4-dev 1:3.3.4-2ubuntu1
 libsepol1 2.2-1
 libslang2 2.2.4-15ubuntu1
 libsnmp-base 5.7.2~dfsg-8.1ubuntu3
 libsnmp30 5.7.2~dfsg-8.1ubuntu3
 libss2 1.42.9-3ubuntu1
 libssl-dev 1.0.1f-1ubuntu2.1
 libssl-doc 1.0.1f-1ubuntu2.1
 libssl1.0.0 1.0.1f-1ubuntu2.1
 libstdc++6 4.8.2-19ubuntu1
 libsystemd-daemon0 204-5ubuntu20.2
 libsystemd-login0 204-5ubuntu20.2
 libtext-charwidth-perl 0.04-7build3
 libtext-iconv-perl 1.7-5build2
 libtext-wrapi18n-perl 0.06-7
 libtinfo5 5.9+20140118-1ubuntu1
 libtsan0 4.8.2-19ubuntu1
 libudev1 204-5ubuntu20.2
 libustr-1.0-1 1.0.4-3ubuntu2
 libuuid1 2.20.1-5.1ubuntu20
 libwrap0 7.6.q-25
 libwrap0-dev 7.6.q-25
 libxtables10 1.4.21-1ubuntu1
 linux-libc-dev 3.13.0-24.47
 lsb-base 4.1+Debian11ubuntu6
 makedev 2.3.1-93ubuntu1
 manpages 3.54-1ubuntu1
 manpages-dev 3.54-1ubuntu1
 module-init-tools 15-0ubuntu6
 mount 2.20.1-5.1ubuntu20
 mountall 2.53
 multiarch-support 2.19-0ubuntu6
 netbase 5.2
 passwd 1:4.1.5.1-1ubuntu9
 perl-base 5.18.2-2ubuntu1
 plymouth 0.8.8-0ubuntu17
 plymouth-theme-ubuntu-text 0.8.8-0ubuntu17
 procps 1:3.3.9-1ubuntu2
 psmisc 22.20-1ubuntu2
 sensible-utils 0.0.9
 systemd-services 204-5ubuntu20.2
 sysv-rc 2.88dsf-41ubuntu6
 sysvinit-utils 2.88dsf-41ubuntu6
 tar 1.27.1-1
 tcpd 7.6.q-25
 tzdata 2014c-0ubuntu0.14.04
 udev 204-5ubuntu20.2
 upstart 1.12.1-0ubuntu4
 util-linux 2.20.1-5.1ubuntu20
 uuid-runtime 2.20.1-5.1ubuntu20
 zlib1g 1:1.2.8.dfsg-1ubuntu1
 zlib1g-dev 1:1.2.8.dfsg-1ubuntu1
DistroRelease: Ubuntu 14.04
InstallationDate: Installed on 2014-05-12 (10 days ago)
InstallationMedia: Ubuntu-Server 12.04.4 LTS "Precise Pangolin" - Release amd64 (20140204)
Package: libsnmp-dev 5.7.2~dfsg-8.1ubuntu3
PackageArchitecture: amd64
ProcEnviron:
 LANGUAGE=en_US:en
 TERM=xterm
 PATH=(custom, no user)
 XDG_RUNTIME_DIR=<set>
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 3.13.0-24.47-generic 3.13.9
SourcePackage: net-snmp
Tags: trusty
Uname: Linux 3.13.0-24-generic x86_64
UpgradeStatus: No upgrade log present (probably fresh install)
_MarkForUpload: True

David Reagan (jerrac) wrote :

Just ran into this today when trying to configure snmp on Ubuntu 14.04.

net-snmp-config --version
5.7.2

net-snmp-config --create-snmpv3-user -ro -A password -a MD5 -x DES username
/usr/bin/net-snmp-config: 236: /usr/bin/net-snmp-config: net-snmp-create-v3-user: not found

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in net-snmp (Ubuntu):
status: New → Confirmed
Tobias W. (conan6398) wrote :

i have the problem too, giv it a solution?

Sascha Lucas (sascha-lucas) wrote :

there are several workarounds:

1) use debian (this is where bugs get fixed)
2) make some noise here, so that launchpad (canonical) can hear you
3) create the config by hand: net-snmp-create-v3-user is just a simple shell script, that was forgotten to be packaged: the content translates to:

stop snmpd

adding the following line to /var/lib/snmp/snmpd.conf:
   createUser $user $Aalgorithm "$apassphrase" $Xalgorithm $xpassphrase

adding the following line to /usr/share/snmp/snmpd.conf:
   $token $user

with:
Aalgorithm=MD5|SHA
Xalgorithm=DES|AES|AES128
token=rouser|rwuser

start snmpd

Tobias W. (conan6398) wrote :

when ein try stop snmpd i become:
root@Ubuntu-1404-trusty-64-minimal ~ # stop snmp
stop: Unknown job: snmp
and start say:
root@Ubuntu-1404-trusty-64-minimal ~ # start snmp
start: Unknown job: snmp

also i becomm ´´d start snmp. :(

s1l3nt (muratmozdemir) wrote :

@Tobias.

do this:

service snmpd stop
OR
service snmpd start

Tobias W. (conan6398) wrote :

ok this is working.

becose, when i modif the /var/lib/snmp/snmpd.conf and than start snmp,
snmp resete the file to default and delete my acc :(

also manuel modifi dont working.

David Reagan (jerrac) wrote :

The workaround in #4 works.

It would still be nice to get the bug fixed. I have some configuration scripts that use net-snmp-create-v3-user. They work great on 12.04, but 14.04 doesn't work.

Tobias W. (conan6398) wrote :

its not working on my ubuntu, her:
root@Ubuntu-1404-trusty-64-minimal /var/lib/snmp # service snmpd stop
 * Stopping network management services: root@Ubuntu-1404-trusty-64-minimal /var/lib/snmp # ls -l
insgesamt 8
drwx------ 2 root root 4096 Aug 16 16:30 mib_indexes
-rw------- 1 snmp snmp 1356 Aug 25 23:05 snmpd.conf
root@Ubuntu-1404-trusty-64-minimal /var/lib/snmp # service snmpd start
 * Starting network management services: root@Ubuntu-1404-trusty-64-minimal /var/lib/snmp # ls -l
insgesamt 8
drwx------ 2 root root 4096 Aug 16 16:30 mib_indexes
-rw------- 1 snmp snmp 1276 Aug 25 23:05 snmpd.conf
root@Ubuntu-1404-trusty-64-minimal /var/lib/snmp #

after "service snmpd start" the file was restore to default.

Wylie (wyl1e) wrote :

This bug (rather just an oversight) pisses me off to no end. It seems as simple as not including the shell script that runs the create-v3-user. The workaround did not work for me, so I copied /usr/bin/net-snmp-create-v3-user from a Centos 6.4 machine. I changed the "outdir" variable at the bottom of the script to /var/lib/snmp (as it is on 14.04).

1. sudo vi /usr/bin/net-snmp-create-v3-user
2. Paste contents of this: http://pastebin.com/uC3y5Kyz
3. chmod +x /usr/bin/net-snmp-create-v3-user

Then run:

net-snmp-create-v3-user -a PASSWORD -x PASSWORD -X DES -A MD5 snmpuser

It essentially does the same as the workaround, but the workaround did not work for me. So there it is. I guess update the package to include this file again?

@Canoncial: quick win
This really is an easy to solve issue / quick win.
Please include:
    /usr/bin/net-snmp-create-v3-user
this will fix this issue (see comment #10 by Wylie for details)

@all other users:
Workaround does really work
=======================
Adding a the createUser line to snmpd as described by Sascha Lucas in comment #4 works also, because is is basically the same steps the script does.
Do not be confused, while starting the snmpd does this steps:
  1. read the "createUser" line in /var/lib/snmp/snmpd.conf
  2. add a new "usmUser" line in /var/lib/snmp/snmpd.conf
  3. remove the "createUser" line
Sure, this may look as if nothing is done or the file is just reset to default, but the user is really created.

Verify User Creation
================
Say you created
  user icinga
  authprotocol SHA
  authpassphrase 'P1'
  privacyprotocol AES
  privacypassphrase 'P2'
then you can check if there is output for:
# snmpwalk -v3 -u icinga -l authPriv -a SHA -A 'P1' -x AES -X 'P2' localhost

Kind regards,
Thorsten

Rarylson Freitas (rarylson) wrote :

I confirmed that this bug ocour in Ubuntu 12.04 and 14.04.

The @thorsten-hesemeyer response [#11] is right! The definitive solution is right and the explanation why adding `createUser $user $Aalgorithm "$apassphrase" $Xalgorithm $xpassphrase` entries work is right too.

More info: The Ubuntu team applied a Debian path that splits the `net-snmp-config` command in two: the new command is the `net-snmp-create-v3user` script. In a first moment, the Debian team forgot to pack the `net-snmp-create-v3user` command (`net-snmp-create-v3user.in` file in the Debian repo). After, they applied a bugfix, packing the missing script and fixing the bug (see: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=726158).

However, this bugfix wasn't merged in Ubuntu yet.

To make the workarround easier, I create a Gist in Github (see: https://gist.github.com/rarylson/72d1414d6907a4548427). So, to workarround this bug:

```
wget https://gist.githubusercontent.com/rarylson/72d1414d6907a4548427/raw/d97aed8debf0a291a0457ec634a3be370bd16546/net-snmp-create-v3-user
chmod +x net-snmp-create-v3-user
mv net-snmp-create-v3-user /usr/local/bin
```

Aiko Barz (aiko-chroot) wrote :

Seriously? Just a missing script from the Debian repository? That is all? Oh dear...

Kind regards,
Aiko

Aiko Barz (aiko-chroot) wrote :

But ... to be more positive: I really would appreciate a new package with the missing script. I really do.

Kind regards,
Aiko

Pander (pander) on 2015-12-02
tags: added: 15.10 wily
vgeloven (vgeloven) on 2015-12-02
tags: added: needs-packaging xenial
Brian Murray (brian-murray) wrote :

*** This is an automated message ***

This bug is tagged needs-packaging which identifies it as a request for a new package in Ubuntu. As a part of the managing needs-packaging bug reports specification, https://wiki.ubuntu.com/QATeam/Specs/NeedsPackagingBugs, all needs-packaging bug reports have Wishlist importance. Subsequently, I'm setting this bug's status to Wishlist.

summary: - libsnmp-dev: Cannot create snmpv3 user with net-snmp-config command
+ [needs-packaging] libsnmp-dev: Cannot create snmpv3 user with net-snmp-
+ config command
Changed in net-snmp (Ubuntu):
importance: Undecided → Wishlist

Thank you for taking the time to report this bug and helping to make Ubuntu better.

@vgeloven: this is not needs-packaging since a fix for this bug doesn't not need a new package, just a fixed one. So I'm removing the needs-packaging tag.

This is presumed fixed in 15.10 since it is on 5.7.3+dfsg-1ubuntu2 and Debian reports it was fixed in 5.7.2.1~dfsg-1, so I'm marking this Fix Released to reflect this. However based on the versions it does appear to still affect Trusty so I'll add a task to track that.

Changed in net-snmp (Ubuntu):
importance: Wishlist → Undecided
tags: removed: needs-packaging
Changed in net-snmp (Ubuntu):
status: Confirmed → Fix Released
Changed in net-snmp (Ubuntu Trusty):
status: New → Triaged
Changed in net-snmp (Ubuntu Vivid):
status: New → Triaged
Changed in net-snmp (Ubuntu Trusty):
importance: Undecided → Medium
Changed in net-snmp (Ubuntu Vivid):
importance: Undecided → Medium
tags: added: bitesize
summary: - [needs-packaging] libsnmp-dev: Cannot create snmpv3 user with net-snmp-
- config command
+ libsnmp-dev: Cannot create snmpv3 user with net-snmp-config command
Changed in net-snmp (Debian):
status: Unknown → Fix Released
Changed in net-snmp (Ubuntu Vivid):
status: Triaged → Won't Fix
Changed in net-snmp (Ubuntu Trusty):
assignee: nobody → Brian Murray (brian-murray)
status: Triaged → In Progress
Brian Murray (brian-murray) wrote :

I've uploaded the fix for this to the 14.04 -proposed queue for review by the SRU team.

Mirzet Kadic (caracal-enl) wrote :

Well, hopefully it's gonna be fixed in 14.04.4

Hello Sascha, or anyone else affected,

Accepted net-snmp into trusty-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/net-snmp/5.7.2~dfsg-8.1ubuntu3.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in net-snmp (Ubuntu Trusty):
status: In Progress → Fix Committed
tags: added: verification-needed
Changed in net-snmp (Ubuntu):
importance: Undecided → Medium
Tom Smith (uom) wrote :

I can confirm that with a fresh install of 14.04.4 using 5.7.2~dfsg-8.1ubuntu3.1 I can reproduce this bug.
Installing the updated version (5.7.2~dfsg-8.1ubuntu3.2) from proposed does fix this bug, and I can create my SNMP user.

tags: added: verification-done
removed: verification-needed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package net-snmp - 5.7.2~dfsg-8.1ubuntu3.2

---------------
net-snmp (5.7.2~dfsg-8.1ubuntu3.2) trusty-proposed; urgency=medium

  * debian/libsnmp-dev.install
    - add missing net-snmp-create-v3-user (LP: #1322431)

 -- Brian Murray <email address hidden> Fri, 12 Feb 2016 14:27:01 -0800

Changed in net-snmp (Ubuntu Trusty):
status: Fix Committed → Fix Released

The verification of the Stable Release Update for net-snmp has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Cyrille Bollu (cyrille-bollu) wrote :

Bug still occur here; The createUser line disapear on snmpd restart,a nd isn't replaced with any other usmUser line or alike.

Here's a log of what happens when using the script given in #12

root@otrs-prod:/etc# dpkg -l snmp
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=====================================================-===============================-===============================-===============================================================================================================
ii snmp 5.7.2~dfsg-8.1ubuntu3.2 amd64 SNMP (Simple Network Management Protocol) applications
root@otrs-prod:/etc# /root/net-snmp-create-v3-user -a xxxxxxxxxx -x xxxxxxxxx -X AES -A SHA opennms
adding the following line to /var/lib/snmp/snmpd.conf:
   createUser opennms SHA "xxxxxxxxxxxx" AES xxxxxxxxxxxxxxx
adding the following line to /etc/snmp/snmpd.conf:
   rwuser opennms
root@otrs-prod:/etc# cat /var/lib/snmp/snmpd.conf
#
# net-snmp (or ucd-snmp) persistent data file.
#
############################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
#
# **** DO NOT EDIT THIS FILE ****
#
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
############################################################################
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for snmpd in SNMPCONFPATH/snmpd.conf.
# Only "createUser" tokens should be placed here by snmpd administrators.
# (Did I mention: do not edit this file?)
#

engineBoots 59
oldEngineID 0x80001f8880f2e5475a8222115100000000
createUser opennms SHA "xxxxxxxxxxxxxxx" AES xxxxxxxxxxxxxxx
root@otrs-prod:/etc# service snmpd start
 * Starting network management services: root@otrs-prod:/etc# cat /var/lib/snmp/snmpd.conf
#
# net-snmp (or ucd-snmp) persistent data file.
#
############################################################################
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
#
# **** DO NOT EDIT THIS FILE ****
#
# STOP STOP STOP STOP STOP STOP STOP STOP STOP
############################################################################
#
# DO NOT STORE CONFIGURATION ENTRIES HERE.
# Please save normal configuration tokens for snmpd in SNMPCONFPATH/snmpd.conf.
# Only "createUser" tokens should be placed here by snmpd administrators.
# (Did I mention: do not edit this file?)
#

engineBoots 60
oldEngineID 0x80001f8880f2e5475a8222115100000000
root@otrs-prod:/etc#

Cyrille Bollu (cyrille-bollu) wrote :

hmm sorry, my bad it wasn't creating the usmUser line because I was loading snmpd with almost no modules due to an error in my /etc/default/snmpd file

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.