updated to show passwords and use hex passwords
This commit is contained in:
12
snmp.sh
12
snmp.sh
@@ -32,8 +32,8 @@ mv /etc/snmp/snmpd.conf /etc/snmp/snmpd.conf.bak
|
|||||||
|
|
||||||
# generate useranme/auth/enc passwords
|
# generate useranme/auth/enc passwords
|
||||||
username=$(openssl rand -hex 8)
|
username=$(openssl rand -hex 8)
|
||||||
authPassword=$(< /dev/urandom tr -cd "[:graph:]" | head -c 32; echo)
|
authPassword=$(openssl rand -hex 32)
|
||||||
encPassword=$(< /dev/urandom tr -cd "[:graph:]" | head -c 32; echo)
|
encPassword=$(openssl rand -hex 32)
|
||||||
|
|
||||||
# create new config file
|
# create new config file
|
||||||
cat <<EOF >> /etc/snmp/snmpd.conf
|
cat <<EOF >> /etc/snmp/snmpd.conf
|
||||||
@@ -55,3 +55,11 @@ chmod +x /usr/bin/distro
|
|||||||
systemctl restart snmpd
|
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