On Ubuntu 14.04, the conifg file for sshd is located at:
Before making any modification, make a copy of the original config and make it read-only:
Then, open up
sshd_config and modify the following lines:
Restart ssh service to make the new config effective:
To limit the number of login attempts during a time period, enable the
Uncomplicated Firewall by:
Then, limit the number of ssh login attempts within 30 seconds to be 10 tries. More attempts will be dropped by issuing this command:
How to config your client
Once the server config has taken effect, you need to update your client ssh config which is found at
~/.ssh/config on your computer.
PubKeyAuthentication and a absolute/relative path to the private_key are added.