Difference between revisions of "Configuration (Ubuntu)"

Jump to navigation Jump to search
→‎Setup (Post v12 Ubunutu): Updated restart command
(→‎SNMP: Added Setup (Post v12))
(→‎Setup (Post v12 Ubunutu): Updated restart command)
 
(2 intermediate revisions by the same user not shown)
Line 71: Line 71:


=== Deny a Specific Host ===
=== Deny a Specific Host ===
If you want to deny a specific host (because its spamming or hacking you for example) you need to ensure that the deny rule is one of the first processed.  Otherwise the host might still be able to access on port 80 (if you're running a web server and have a general allow rule for http traffic).  It's easiest to edit the config files directly.
If you want to deny a specific host (because its spamming or hacking you for example) you need to ensure that the deny rule is one of the first processed.  Otherwise the host might still be able to access on port 80 (if you're running a web server and have a general allow rule for http traffic).  To do so you need to insert a deny rule at the top of your rule-set,


To deny all traffic from 46.118.117.13...
To deny all traffic from 46.118.117.13...
<pre> ufw insert 1 deny from 46.118.117.13 to any </pre>
Alternatively you can edit the UFW config file direct, but the denied hosts will ''not'' appear when showing the firewall status, which will cause you problems later down the line...
# Edit <code>/etc/ufw/before.rules</code>
# Edit <code>/etc/ufw/before.rules</code>
# Create a new section under the <code> # drop INVALID packets </code> section (near the top of the file)
# Create a new section under the <code> # drop INVALID packets </code> section (near the top of the file)
Line 82: Line 85:
# Reload the firewall to apply the new config
# Reload the firewall to apply the new config
#* <code> ufw reload </code>
#* <code> ufw reload </code>
Note that the denied hosts will ''not'' appear when showing the firewall status, which is an irritation.


= SNMP =
= SNMP =
Line 140: Line 141:
  syscontact info@sandfordit.com
  syscontact info@sandfordit.com


=== Setup (Post v12) ===
== Setup (Post v12 Ubunutu) ==
# Run the following command to update the package database
# Run the following command to update the package database
#* <code> apt-get update </code>
#* <code> apt-get update </code>
Line 147: Line 148:
# Replace existing config file with contents as shown below the procedure
# Replace existing config file with contents as shown below the procedure
#* <code> vi /etc/snmp/snmpd.conf </code>
#* <code> vi /etc/snmp/snmpd.conf </code>
# Throttle down logging verbosity (otherwise log is spammed with <code>Connection from UDP</code> messages
#* <code> vi /etc/default/snmpd </code>
#* Set the option <code>-LS0-5d</code> so the config line starts...
#* <code>SNMPDOPTS='-LS0-5d -Lf /dev/null </code>
# Restart SNMP
# Restart SNMP
#* <code> /etc/init.d/snmpd restart </code>
#* <code> systemctl restart snmpd </code>
# Test with the following, replacing <hostname> with server's hostname (must be run from a machine with snmp installed, not just snmpd)
# Test with the following, replacing <hostname> with server's hostname (must be run from a machine with snmp installed, not just snmpd)
#* <code> snmpwalk -v 1 -c public <hostname> system <hostname> </code>
#* <code> snmpwalk -v 1 -c public <hostname> system <hostname> </code>

Navigation menu