I have Ubuntu Server 14.04 LTS. I have Public key authentication enabled by default.
I used the following command to create new user:
sudo useradd -m -c "John T." john -s /bin/bash
The command apparently created user, user's home folder... but obviously user cannot log in, because user does not have a key. What's next? How to create key and attach it to the user?
-c -- User's full name
-m -- Creates user's home directory
-s -- Specify user's login shell