bofrede said about 7 years ago on Managing Servers with Ansible :

A simpler way to get the public key on to the server:

ssh-copy-id www.example.com

Assuming your local and remote usernames are the same. If not, prepend the username and an at sign before the hostname, just like any other ssh command.

The utility is available in Homebrew for Mac OS:

brew install ssh-copy-id