We have 2 servers, one each located at different geographical locations where we are considering using an rsync script to keep certain folders in sync. Our setup disables root login and password logins and relies on keyfiles.
We run SSH on port 22X (just to minimize the login attempts, not as a way of security through obscurity).
If we setup port forwarding so that port XYZ forwards to 22X, and have disabled password logins, what other measures should we take to prevent any malicious activity occurring because of the open port?
My thinking is that as long as we keep our keys secure, then there should not be an issue. have I missed something?
Regarding exclusively the security on the
sshd
service, these are some extra measures you could implement, in no particular order:sshd
daemon is expected to be used only between this two peers, aniptables
rule restricting access to port 22X based on source IP address.tcpwappers
ACL.fail2ban
can add rules dynamically to bothiptables
and/etc/hosts.allow
to mitigate brute-force attacks.fwknop
is available in some distributions.openssh
you use, you can setup two-factor authentication, usingkerberos
for example.