updated to show passwords and use hex passwords
This commit is contained in:
14
snmp.sh
14
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 <<EOF >> /etc/snmp/snmpd.conf
|
||||
@@ -54,4 +54,12 @@ chmod +x /usr/bin/distro
|
||||
|
||||
systemctl restart snmpd
|
||||
|
||||
systemctl enable snmpd
|
||||
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}"
|
||||
Reference in New Issue
Block a user