<div dir="ltr">There is no security in obscurity - what changing the port offers is orders of magnitude less noise in the logs.  If you or your tools never look at the logs than it understandably doesn&#39;t matter one whit to you.  However if you are trying to keep on top of things with log analyzers, OSSEC, elasticsearch, etc, it is on the MUST DO list.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 13, 2017 at 12:39 PM, Joshua Judson Rosen <span dir="ltr">&lt;<a href="mailto:rozzin@hackerposse.com" target="_blank">rozzin@hackerposse.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/12/2017 01:27 PM, Dan Coutu wrote:<br>
<span class="">&gt;&gt; On Jun 12, 2017, at 13:15, Tom Buskey &lt;<a href="mailto:tom@buskey.name">tom@buskey.name</a> &lt;mailto:<a href="mailto:tom@buskey.name">tom@buskey.name</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; As Ted said in the 2nd sentence, it&#39;s running on a non-standard port.  Yes, it helps lot to reduce garbage in the logs.<br>
&gt;<br>
</span><span class="">&gt; Insisting on the use of an ssh key instead of login credentials also helps a lot.<br>
<br>
</span>Helps with the security, anyway; and not blacklisting based on source-address<br>
means that you&#39;ll never be locked out of your own server just because<br>
some machine at the hotel where you&#39;re staying is (or has been) part of<br>
the communist party^W^W^W a botnet.<br>
<br>
*Doesn&#39;t* help cut down on logspam. ;)<br>
<br>
But adding liberal ignore rules into logcheck (or whatever) helps a lot with logspam ;)<br>
<br>
I don&#39;t care about the probes of nonexistent accounts, for example;<br>
I just care about attempts on accounts that someone/something might actually<br>
be able to log into if they somehow got a compromised key;<br>
so I ignore attempts on nonexistent logins--and many usernames that do exist<br>
but aren&#39;t able to _log in_, and I explicitly monitor for things like attempts<br>
on my own specific username....<br>
<span class=""><br>
&gt;&gt; Maybe it&#39;s not non-standard enough?<br>
<br>
</span>Portscans are easy enough, especially using the new `horde of slow brutes&#39;<br>
techniques from the 1990s.... I&#39;ve always been impressed with how _few_<br>
of those I saw, and by the fact that moving services to nonstandard ports<br>
was as effective as it was at reducing the connection-attempts to those services.<br>
<br>
The whole &quot;I have ssh on a secret port to secure it against attacks&quot; thing<br>
has always seemed fundamentally bogus to me: the _premise_ of ssh itself is<br>
that you&#39;re supposed to be able to assume that the network is in fact<br>
extremely hostile--more hostile than any network where<br>
`hiding in a non-standard port&#39; could ever be useful.<br>
<span class="im HOEnZb"><br>
<br>
&gt;&gt; On Mon, Jun 12, 2017 at 12:42 PM, Bruce Dawson &lt;<a href="mailto:jbd@codemeta.com">jbd@codemeta.com</a> &lt;mailto:<a href="mailto:jbd@codemeta.com">jbd@codemeta.com</a>&gt;&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt;     I have to second this suggestion - changing the port did wonders for our servers. Of course, as Dan says, it works<br>
&gt;&gt;     for script kiddies, not so much against a determined attack on your server.<br>
&gt;&gt;<br>
&gt;&gt;     --Bruce<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;     On 06/12/2017 09:59 AM, Dan Garthwaite wrote:<br>
&gt;&gt;&gt;     If you can change the port number it does wonders against the script kiddies.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;     Just remember to add the new port, restart sshd, then remove the old port.  :)<br>
&gt;&gt;&gt;<br>
</span><span class="im HOEnZb">&gt;&gt;&gt;     On Sun, Jun 11, 2017 at 1:53 PM, Ted Roche &lt;<a href="mailto:tedroche@gmail.com">tedroche@gmail.com</a> &lt;mailto:<a href="mailto:tedroche@gmail.com">tedroche@gmail.com</a>&gt;&gt; wrote:<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         Thanks, all for the recommendations. I hadn&#39;t seen sshguard before;<br>
&gt;&gt;&gt;         I&#39;ll give that a try.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         I do have Fail2Ban in place, and have customized a number of scripts,<br>
&gt;&gt;&gt;         mostly for Apache (trying to invoke asp scripts on my LAMP server<br>
&gt;&gt;&gt;         results in instaban, for example) and it is what it reporting the ssh<br>
&gt;&gt;&gt;         login failures.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         I have always seen them, in the 10 years I&#39;ve had this server running,<br>
&gt;&gt;&gt;         but the frequency, periodicity and international variety (usually<br>
&gt;&gt;&gt;         they&#39;re all China, Russian, Romania) seemed like there might be<br>
&gt;&gt;&gt;         something else going on.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;         Be careful out there.<br>
&gt;&gt;&gt;<br>
</span><span class="im HOEnZb">&gt;&gt;&gt;         On Sun, Jun 11, 2017 at 11:19 AM, Mark Komarinski &lt;<a href="mailto:mkomarinski@wayga.org">mkomarinski@wayga.org</a> &lt;mailto:<a href="mailto:mkomarinski@wayga.org">mkomarinski@wayga.org</a>&gt;<wbr>&gt; wrote:<br>
&gt;&gt;&gt;         &gt; sshguard is really good since it&#39;ll drop in a iptables rule to block an IP<br>
&gt;&gt;&gt;         &gt; address after a number of attemps (and prevent knocking on other ports too).<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; Yubikey as 2FA is pretty nice too.<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; -------- Original message --------<br>
</span><span class="im HOEnZb">&gt;&gt;&gt;         &gt; From: Bruce Dawson &lt;<a href="mailto:jbd@codemeta.com">jbd@codemeta.com</a> &lt;mailto:<a href="mailto:jbd@codemeta.com">jbd@codemeta.com</a>&gt;&gt;<br>
&gt;&gt;&gt;         &gt; Date: 6/11/17 10:58 AM (GMT-05:00)<br>
</span><div class="HOEnZb"><div class="h5">&gt;&gt;&gt;         &gt; To: <a href="mailto:gnhlug-discuss@mail.gnhlug.org">gnhlug-discuss@mail.gnhlug.org</a> &lt;mailto:<a href="mailto:gnhlug-discuss@mail.gnhlug.org">gnhlug-discuss@mail.<wbr>gnhlug.org</a>&gt;<br>
&gt;&gt;&gt;         &gt; Subject: Re: What&#39;s the strategy for bad guys guessing a few ssh passwords?<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; sshguard takes care of most of them (especially the high bandwidth ones).<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; The black hats don&#39;t care - they&#39;re looking for vulnerable systems. If<br>
&gt;&gt;&gt;         &gt; they find one, they&#39;ll exploit it (or not).<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; Note that a while ago (more than a few years), comcast used to probe<br>
&gt;&gt;&gt;         &gt; systems to see if they&#39;re vulnerable. Either they don&#39;t do that any<br>
&gt;&gt;&gt;         &gt; more, or contract it out because I haven&#39;t see probes from any of their<br>
&gt;&gt;&gt;         &gt; systems in years. This probably holds true for other ISPs, and various<br>
&gt;&gt;&gt;         &gt; intelligence agencies in the world - both private and public, not to<br>
&gt;&gt;&gt;         &gt; mention various disreputable enterprises.<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; --Bruce<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt;<br>
&gt;&gt;&gt;         &gt; On 06/11/2017 10:17 AM, Ted Roche wrote:<br>
&gt;&gt;&gt;         &gt;&gt; For 36 hours now, one of my clients&#39; servers has been logging ssh<br>
&gt;&gt;&gt;         &gt;&gt; login attempts from around the world, low volume, persistent, but more<br>
&gt;&gt;&gt;         &gt;&gt; frequent than usual. sshd is listening on a non-standard port, just to<br>
&gt;&gt;&gt;         &gt;&gt; minimize the garbage in the logs.<br>
&gt;&gt;&gt;         &gt;&gt;<br>
&gt;&gt;&gt;         &gt;&gt; A couple of attempts is normal; we&#39;ve seen that for years. But this is<br>
&gt;&gt;&gt;         &gt;&gt; several each  hour, and each hour an IP from a different country:<br>
&gt;&gt;&gt;         &gt;&gt; Belgium, Korea, Switzerland, Bangladesh, France, China, Germany,<br>
&gt;&gt;&gt;         &gt;&gt; Dallas, Greece. Usernames vary: root, mythtv, rheal, etc.<br>
&gt;&gt;&gt;         &gt;&gt;<br>
&gt;&gt;&gt;         &gt;&gt; There&#39;s several levels of defense in use: firewalls, intrusion<br>
&gt;&gt;&gt;         &gt;&gt; detection, log monitoring, etc, so each script gets a few guesses and<br>
&gt;&gt;&gt;         &gt;&gt; the IP is then rejected.<br>
&gt;&gt;&gt;         &gt;&gt;<br>
&gt;&gt;&gt;         &gt;&gt; In theory, the defenses should be sufficient, but I have a concern<br>
&gt;&gt;&gt;         &gt;&gt; that I&#39;m missing their strategy here. It&#39;s not a DDOS, they are very<br>
&gt;&gt;&gt;         &gt;&gt; low volume. It will take them several millennia to guess enough<br>
&gt;&gt;&gt;         &gt;&gt; dictionary attack guesses to get through, so what&#39;s the point?<br>
______________________________<wbr>_________________<br>
gnhlug-discuss mailing list<br>
<a href="mailto:gnhlug-discuss@mail.gnhlug.org">gnhlug-discuss@mail.gnhlug.org</a><br>
<a href="http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/" rel="noreferrer" target="_blank">http://mail.gnhlug.org/<wbr>mailman/listinfo/gnhlug-<wbr>discuss/</a><br>
</div></div></blockquote></div><br></div>