Introduction

A short post, documenting the process of copying your SSH keys from Windows 10 to linux host.

This will save future Brad having to go on a duck hunt to find this information for the 10 billionth time.

Requirements

In recent versions of Windows 10 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 a powershell prompt.

cmd

cat ~/.ssh/id_rsa.pub | ssh <user>@<host> "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
    

Credit for this magic goes to this serverfault answer.

Summary

And done. Future Brad, your welcome

Tags

windows