It turns out I have wasted hours, perhaps days, if not weeks, executing

scp id_rsa.pub user@hostname:

and then possibly doing things like

mkdir ~/.ssh
chmod 700 ~./ssh
mv id_rsa.pub ~/.ssh/authorized_keys
chmod 600 ~/.ssh/authorized_keys

All I had to do was:

ssh-copy-id -i ~/.ssh/id_rsa.pub user@hostname

If I said something stupid like: “this is why I love my job, because I can learn something new every day”, I would only feel more pathetic.

TODO: verify when this command was introduced and in which distros