How to create new user with Public key authentication?

Solution 1:

You need to store his public key in ~john/.ssh/authorized_keys as described in manual page for sshd (good place to start). Also you need to make sure the ~john/.ssh/ directory is owned by john and has 0700 permissions and ~john/.ssh/authorized_keys also with permissions 0600.

Then the user should be able to log in.