...
SSH Server with Key Based Authentication
Enable ssh login through the UI by clicking "System Preferences", "Sharing", checking "Remote Login" and allowing access to your preferred accounts.
Then try user password authentication and also try Key Based Authentication as outlined in the Ubuntu articles (the instructions are compatible).
Only after you have ssh key authentication working go to the final step to further harden to not allow passwords.
Tested on OS X 10.12.4 and 10.9.3,
...