Setup a Linux Server

Setup a Linux Server

Copy SSH Key from Windows 10/11 to Linux Host

Requirements
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 joedirt@joedirt.com “cat >> ~/.ssh/authorized_keys”

Hope this helps!!

Copy SSH Key from Windows 10/11 to Linux Host
Scroll to top