How to execute a script that asks password with snmp

391 views Asked by At

i have been trying to execute a script with snmpget that has this code :

#!/bin/bash
sudo -S ufw disable

But when i use SNMPGET to execute this script , terminal asks password as an output :

NET-SNMP-EXTEND-MIB::nsExtendOutLine."script1".1 = STRING: [sudo] password for Debian-snmp:

So my question is that how can i fix the issue legally ?

1

There are 1 answers

5
TallChuck On

You can send the sudo password, and any other input for your script, using nsExtendInput.