ssh-copy-id <username>@<host>
Don’t forget to create your SSH key first.
Example:
root@odroidu2-1:~# ssh-copy-id pi@192.168.1.146
pi@192.168.1.146's password: (enter password)
Now try logging into the machine, with "ssh 'pi@192.168.1.146'", and check in:
~/.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
root@odroidu2-1:~# ssh pi@192.168.1.146
...
pi@rpi-torrent ~ $
More info
Use ssh-copy-id when SSH port is not 22. (Custom port.)