<p><b>WARNING</b>: It's easy to lock yourself out of a system implementing these changes so make sure you have physical access to the console of the system you are securing.</p>

<p>To display all processes listening</p>
<pre><code>  netstat -anp | grep -i listen
</code></pre>

Deny all connections to any port from any external IP address
<pre><code>/etc/hosts.deny
  all:all

/etc/hosts.allow
  sshd:192.168.1.54 # My other pc
</code></pre>

<p>IPTables Tutorial: <a href="https://iptables-tutorial.frozentux.net/">https://iptables-tutorial.frozentux.net/</a></p>

<p>A good starting point to block all except ssh:
<a href="https://www.cyberciti.biz/tips/linux-iptables-4-block-all-incoming-traffic-but-allow-ssh.html">https://www.cyberciti.biz/tips/linux-iptables-4-block-all-incoming-traffic-but-allow-ssh.html</a></p>

<p>Disable root login via ssh: <a href="https://www.howtogeek.com/howto/linux/security-tip-disable-root-ssh-login-on-linux/">https://www.howtogeek.com/howto/linux/security-tip-disable-root-ssh-login-on-linux/</a></p>

<p>Setting up ssh keys and disabling password logins.</p>

<p><a href="https://www.debuntu.org/ssh-key-based-authentication">https://www.debuntu.org/ssh-key-based-authentication</a></p>

