LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 07-13-2010, 09:03 PM   #1
gimpy530
Member
 
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:

Code:
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.

Code:
.1.4.3.1.1.5.116.101.115.116.48 = STRING: "root"
.1.4.3.1.1.5.116.101.115.116.49 = 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:

Code:
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.
 
  


Reply


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


All times are GMT -5. The time now is 05:06 AM.

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