diff --git a/snmp.sh b/snmp.sh index e481740..2c9fab5 100644 --- a/snmp.sh +++ b/snmp.sh @@ -32,8 +32,8 @@ mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak # generate useranme/auth/enc passwords username=$(openssl rand -hex 8) -authPassword=$(< /dev/urandom tr -cd "[:graph:]" | head -c 32; echo) -encPassword=$(< /dev/urandom tr -cd "[:graph:]" | head -c 32; echo) +authPassword=$(openssl rand -hex 32) +encPassword=$(openssl rand -hex 32) # create new config file cat <> /etc/snmp/snmpd.conf @@ -54,4 +54,12 @@ chmod +x /usr/bin/distro systemctl restart snmpd -systemctl enable snmpd \ No newline at end of file +systemctl enable snmpd + +echo "#########################################################################" +echo "## Encryption Details ##" +echo "## Please enter the Username and Auth/Enc Passwords on Libernms Server ##" +echo "#########################################################################" +echo "Username = ${username}" +echo "Auth (SHA) Password = ${authPassword}" +echo "Enc (AES) Password = ${encPassword}" \ No newline at end of file