Disable SSH Password Login in Ubuntu 18.04

nano /etc/ssh/sshd_config

Use ctrl+w to find “PasswordAuthentication” and then change it to “no”, save it.

...
PasswordAuthentication no