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

scp user@hostname:

and then possibly doing things like

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

All I had to do was:

ssh-copy-id -i ~/.ssh/ 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