Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Oct 2015 19:35:30 +0100
From:      Matt Smith <fbsd@xtaz.co.uk>
To:        Christopher Sean Hilton <chris@vindaloo.com>
Cc:        Ian Smith <smithi@nimnet.asn.au>, freebsd-questions@freebsd.org
Subject:   Re: Protecting sshd - Was: SSHguard & IPFW
Message-ID:  <20151001183530.GE15788@xtaz.uk>
In-Reply-To: <20151001164935.GA1268@hadar.local>
References:  <mailman.98.1443614402.37653.freebsd-questions@freebsd.org> <20151001033001.R67283@sola.nimnet.asn.au> <CALf6cgY0TYxugyMWd7ugpL5YgjKYiX%2Bk35%2BP1%2BzwbDMJw9T2Jw@mail.gmail.com> <20151001173313.T67283@sola.nimnet.asn.au> <20151001164935.GA1268@hadar.local>

next in thread | previous in thread | raw e-mail | index | archive | help
On Oct 01 12:49, Christopher Sean Hilton wrote:
>The crux of the issue is ssh with password auth. You are either
>allowing passwords or you aren't. If you aren't allowing passwords
>then the brute force industry chances of successfully compromising
>your servers are very very low and you are relatively safe. If you
>allow passwords, you're open to their attack and if you have any weak
>passwords, it's a matter of time.

There are two ports which provide a pam module which is very handy for 
adding two factor authentication to ssh. security/oath-toolkit is the 
one I use but there is also security/pam_google_authenticator. With one 
of these you can add a line to /etc/pam.d/sshd and use an app on your 
phone which supports HOTP/TOTP, I personally use the Google 
Authenticator app. You generate a secret and scan it into the phone with 
a QR code and it shows a 6 digit number which changes every 30 seconds.

Then if you log in to ssh with a certificate it works like normal. If 
you log in to ssh with a password then it *also* asks for the latest 
code from your phone in addition to the password. Hugely more secure as 
even if somebody on the internet knows your password, it's highly 
unlikely they will also know the code currently displayed on your phone.


-- 
Matt



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151001183530.GE15788>