Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 07-13-2010, 09:03 PM   #1
Registered: Oct 2007
Posts: 98

Rep: Reputation: 16
Net-SNMP - Run a command as root with "extend" feature

Using the extend feature in snmpd.conf I can see the command is being ran as root but does not have root privs. Take this example of an snmpd.conf:

rocommunity whatev
extend .1.4 test0 /usr/bin/whoami
extend .1.4 test1 /bin/touch /root/foo
...which gives the following output on a walk that shows that it runs everything as root, but cannot write to a directory which is writable by root.

. = STRING: "root"
. = STRING: "/bin/touch: cannot touch `/root/foo': Permission denied"
Even if I simply have snmpd.conf run a script which uses sudo, it fails with the error "sudo: can't set runas group vector: Operation not permitted". A line like this in the snmpd.conf gives the same error:

extend .1.4 test1 /usr/bin/sudo /bin/touch /root/foo
Running the sudo commands in a normal BASH session works fine so this is a net-snmp issue.

How can I get root access?

Last edited by gimpy530; 07-13-2010 at 09:07 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Gentoo - addition of "ucd-snmp/diskio" module to Net-SNMP ursusca Linux - Server 2 08-03-2012 02:59 AM
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
Net-Snmp: Cannot extend agent to run script from configuration file skatersam0 Linux - Networking 2 06-30-2009 11:11 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
HP Officjet software install slackware - "configure: error: cannot find net-snmp" Old_Fogie Linux - Hardware 1 05-03-2006 01:01 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration