In recent versions of Windows 10/11 you can enable both an SSH client and server. This post assumes that you have the SSH client enabled and you have generated SSH keys.
You can generate SSH keys with the ssh-keygen.exe command.
Make It So
Once you have your SSH keys generated, the following command will copy them to the target host. It will also create the ~/.ssh/ directory and the authorized_keys file if they do not exist.
Run this oneliner from the terminal.
cat ~/.ssh/id_rsa.pub | ssh <user>@<host> "cat >> ~/.ssh/authorized_keys"
So for example: cat ~/.ssh/id_rsa.pub | ssh email@example.com “cat >> ~/.ssh/authorized_keys”
Hope this helps!!