TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

FreeBSD SSH Hardening

164 pointsby rodrigo975over 3 years ago

10 comments

hannobover 3 years ago
SSH hardening guide bonus edition: Disable password login if you can, leave the algorithm settings as they are and use an up to date version of OpenSSH.<p>OpenSSH already agressively deprecates algorithms that are problematic. None of the algorithms enabled by default has any known security issue. But your manual tweaks from a random document you read on the Internet may enable an algorithm that we may later learn to be problematic.
评论 #28538750 未加载
评论 #28539164 未加载
评论 #28540711 未加载
评论 #28538255 未加载
chasilover 3 years ago
Is it really necessary to disable an E521 ECDSA host key? By all means, replace a P256 host key with E521, but are E521 keys truly weak to justify removal?<p>E521 is listed as safe on DJB&#x27;s main evaluation site:<p><a href="https:&#x2F;&#x2F;safecurves.cr.yp.to&#x2F;" rel="nofollow">https:&#x2F;&#x2F;safecurves.cr.yp.to&#x2F;</a><p>More specific DJB commentary: &quot;To be fair I should mention that there&#x27;s one standard NIST curve using a nice prime, namely 2^521 – 1; but the sheer size of this prime makes it much slower than NIST P-256.&quot;<p><a href="http:&#x2F;&#x2F;blog.cr.yp.to&#x2F;20140323-ecdsa.html" rel="nofollow">http:&#x2F;&#x2F;blog.cr.yp.to&#x2F;20140323-ecdsa.html</a><p>I believe that OpenSSH is using the E521 provided by OpenSSL (as seen on Red Hat 7):<p><pre><code> $ openssl ecparam -list_curves secp256k1 : SECG curve over a 256 bit prime field secp384r1 : NIST&#x2F;SECG curve over a 384 bit prime field secp521r1 : NIST&#x2F;SECG curve over a 521 bit prime field prime256v1: X9.62&#x2F;SECG curve over a 256 bit prime field </code></pre> These appear to have been contributed by Sun Microsystems, and were designed to avoid patent infringement.<p><a href="https:&#x2F;&#x2F;security.stackexchange.com&#x2F;questions&#x2F;3519&#x2F;can-ecc-be-used-without-infringing-on-patents" rel="nofollow">https:&#x2F;&#x2F;security.stackexchange.com&#x2F;questions&#x2F;3519&#x2F;can-ecc-be...</a>
评论 #28539012 未加载
评论 #28546881 未加载
评论 #28542911 未加载
beermonsterover 3 years ago
Not everyone knows that you can use MFA with SSH. I’ve successfully used Google authenticator via PAM[1] and YubiKey[2].<p>You can also setup SSH certificate authorities instead of using self-signed ones [3]<p>[1] <a href="https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Google_Authenticator" rel="nofollow">https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Google_Authenticator</a><p>[2] <a href="https:&#x2F;&#x2F;developers.yubico.com&#x2F;SSH&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developers.yubico.com&#x2F;SSH&#x2F;</a><p>[3] <a href="https:&#x2F;&#x2F;jameshfisher.com&#x2F;2018&#x2F;03&#x2F;16&#x2F;how-to-create-an-ssh-certificate-authority&#x2F;" rel="nofollow">https:&#x2F;&#x2F;jameshfisher.com&#x2F;2018&#x2F;03&#x2F;16&#x2F;how-to-create-an-ssh-cer...</a>
评论 #28539548 未加载
评论 #28545317 未加载
评论 #28542302 未加载
评论 #28539763 未加载
lamnkover 3 years ago
The first thing i do on a new remote box is to move SSH to another non-standard port other than 22. I use the same port for every remote boxes I have. Then add that port into `.ssh&#x2F;config` on local box.<p>Second is to disable root login.<p>Third is to copy my private key over and disable password login.<p>3 essential steps to secure SSH.
评论 #28540762 未加载
评论 #28539499 未加载
评论 #28538415 未加载
评论 #28538514 未加载
lou1306over 3 years ago
Relevant: If your SSH server is public, you can give its address to <a href="https:&#x2F;&#x2F;sshcheck.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sshcheck.com&#x2F;</a> and it will report any weak spots in your config.
评论 #28538912 未加载
评论 #28538543 未加载
评论 #28543960 未加载
评论 #28539566 未加载
评论 #28538376 未加载
评论 #28539926 未加载
beermonsterover 3 years ago
When using the SSH protocol for running automated remote commands you can improve security using forced command[1] within your authorized_keys file.<p>[1] <a href="https:&#x2F;&#x2F;ctrlnotes.com&#x2F;restrict-a-user-to-ssh-forced-command&#x2F;#" rel="nofollow">https:&#x2F;&#x2F;ctrlnotes.com&#x2F;restrict-a-user-to-ssh-forced-command&#x2F;...</a>
评论 #28539651 未加载
tiffanyhover 3 years ago
NanoBSD?<p>I feel like an important part of &quot;hardening&quot; a server is to remove&#x2F;disable unused services. Does anyone know if NanoBSD is actively worked-on by the FreeBSD team and&#x2F;or still in use? For those note aware, NanoBSD is an official build from FreeBSD team that allows you to compile a slimmed down FreeBSD build that is read-only yet can run any&#x2F;all FreeBSD software.<p>I can find very little about NanoBSD other than a handful of posts from 10 years ago. It seems like a great foundation for hardening a server.<p><a href="https:&#x2F;&#x2F;docs.freebsd.org&#x2F;en&#x2F;articles&#x2F;nanobsd&#x2F;" rel="nofollow">https:&#x2F;&#x2F;docs.freebsd.org&#x2F;en&#x2F;articles&#x2F;nanobsd&#x2F;</a>
评论 #28539332 未加载
samgranieriover 3 years ago
I like reading tutorials on this subject. One of my favorites, albeit six years old, is <a href="https:&#x2F;&#x2F;stribika.github.io&#x2F;2015&#x2F;01&#x2F;04&#x2F;secure-secure-shell.html" rel="nofollow">https:&#x2F;&#x2F;stribika.github.io&#x2F;2015&#x2F;01&#x2F;04&#x2F;secure-secure-shell.ht...</a>
mkjover 3 years ago
It generates a new RSA key but disables it in the config? Seems a bit much mindless cut and paste.
tester756over 3 years ago
I always heard that FreeBSD has unparalleled networking<p>Does it mean that it&#x27;d be worth picking FreeBSD over Linux for my C# crud app if it had to handle a lot of requests&#x2F;sec? (let&#x27;s ignore db for the moment)
评论 #28537946 未加载
评论 #28538078 未加载
评论 #28538391 未加载
评论 #28538842 未加载
评论 #28540787 未加载
评论 #28537879 未加载
评论 #28537731 未加载