Thanks to all for your answers and experiencies , finaly the method I choose is both
the key and then password
Code:
AuthenticationMethods publickey,keyboard-interactive
I have tested and it works as expected
1) if the remote client dont have the public key is kicked out
2)when the remote client have the remote key THEN is asked for the user password
and also protect the key with password
in a production server of course, its seems very secure
SirDice
Some of the bad people on the internet are aware their connections will get blocked automatically when there's a number of failed attempts within a small time period. So they try to fly below the radar and only do 1 or 2 attempts per hour for example. SSHguard won't trigger on those. You still need to keep an eye on /var/log/auth.log. The daily security emails will also contain a list of login failures, definitely read it regularly.
Good advise, they will take maybe tooo much long time to brute-force the password,but check
the logs, and maybe one script to filter the failed attempts and send a alert to me via cron job is a good idea
and "never open a ssh port to the internet" idea is changing for "open it,but up to date and secure"
Lamia
In case of a system failure and one needs to get in, for a PC using ssh-keys, the only way out is reaching the Qemu/KVM console, boot into single-user mode, disable use of ssh-keys, log-in with pwd (but no ashing with root) and get the job done.
All servers are bare-metal, but you let me thinking
my question was made in a "internet and lan access scenario", but is someone get physical access
to the bare-metal server,boot it with a live system, change the sshd_config file directive of using
keys to passwords, damage the ssguard command(rename it for ex)
reboot and done, brute-force all you want
the solution firts is to protect the server(bios password,boot order,devices,etc)
but if the attack is serious ,they will reset the bios password physicaly ?
so,whe are in the same posible attack scenario
how this can be avoided?