This link from digitalocean.com about how to use ssh key as login is very good. But the last part about shutting down login with password doesn't work on my droplet. If I only set the
other computer still gets prompt asking password.
So I modified PasswordAuthentication to
Finally other computer doesn't prompt password input requirement.
If you only want to deny root login with password:
Match User root PasswordAuthentication no