Windows, OpenSSH & keys

Since the end of 2017, Microsoft offers native OpenSSH-functionality in Windows 10. And while PuTTY has accompanied me for a number of years, I'm not exactly sad to finally get 'the real deal', so I can painlessly pretend I'm being productive while I'm on Windows (No, that's not a game you see minimized in the taskbar. Move along, peasant!).

While PuTTY generally supported key-based authentication, which I use for all my machines – because I can't be arsed to get a proper, physically separated second factor configured – it required you to convert them into a specific format, which was annoying as hell, especially given the semi-optimal UX-experience PuTTY provides.

Since the ssh-binary that comes with Windows is a portable version of OpenSSH, you can just use your 'normal' SSH-key, however when I inserted my USB-stick and tried to access the key, the following happened:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions for '.\idrsa' are too open. it is required that your private key files are NOT accessible by >others. This private key will be ignored. Load key “.\idrsa”: bad permissions

Easy, I'll just chmod 400 this and I should be rea.. and that was the moment when I realized that I'm on Windows, and there's no such thing as chmod. So, how to fix that?

Once upon a time, I happened to learn some degree of Windows, so I figured that prohibiting everyone except me from accessing that file would work. To do that, right-click on the key-file in Windows Explorer, choose Properties –> Security –> Advanced

In the Advanced-tab, make sure to 'Disable inheritance' and remove all existing permission-entries:

Afterwards, add yourself as sole owner with full permissions:

And that's it, you should be ready to go now. If your computer is now broken, I don't take any responsibility because I know jack shit about Windows!