Make sure when executing Michael Krelin's solution you do the following
cat <your_public_key_file> >> ~/.ssh/authorized_keys
Note the double >
without the double >
the existing contents of authorized_keys will be over-written (nuked!) and that may not be desirable