Skip to content

Anti-random

Topic: Living

File based SSH keys and agent forwarding in Windows and WSL

This is a follow-up to the hardware based SSH keys post , to document the reverse i.e. from hardware SSH keys to file-based SSH keys. File based SSH keys are weaker since they're on your hard drive in the clear but...

Written by Sid ShaytayEngineer, founder, and writer

Published on Updated on 1 min read

This is a follow-up to the hardware based SSH keys post, to document the reverse i.e. from hardware SSH keys to file-based SSH keys. File based SSH keys are weaker since they're on your hard drive in the clear but they are also convenient.

Windows 10

  1. Disable automatic startup of start wsl-ssh-pagent.bat if you added that from the previous blog post.
    Start -> type 'startup' -> Startup Apps -> scroll to start wsl-ssh-pagent.bat -> Toggle off.
  2. You may need to update the OpenSSH binaries shipped in Windows 10 since even the Windows 10 v20.04 binaries can give an agent returned different signature type error sometimes.
    • Navigate to the folder where you extracted the files above and install by running the script .\install-sshd.ps1
  3. Make sure you do NOT have the environment variable SSH_AUTH_SOCK defined. Type $env:SSH_AUTH_SOCK and hit enter in a powershell terminal. If it's undefined, you should see no output, good!
  4. Hit Start -> type "services" -> scroll to "OpenSSH Authentication Agent". It should have status "Running" and Startup type "Automatic".

WSL (Windows Subsystem for Linux)

  1. Open a WSL terminal
  2. nano ~/.profile
  3. add { eval ssh-agent; ssh-add /path/to/my/key; } &>/dev/null at the end
  4. comment or remove export SSH_AUTH_SOCK=/mnt/c/tools/wsl-ssh-pageant/wsl-ssh-agent.sock (or similar) if you had previously added it

Three more notes from the same notebook, picked by topic and not by an algorithm.

All posts
  • Living

    Returning to social media, curated version!

    2020 has been a crazy year! You don't need me to tell you that. The pandemic. The movement against civil injustice. The crazy polarizing election cycle. The January 6th 2021 attack on the Capitol. Those are all...

    Sid Shaytay3 min read
  • Living

    How I got COVID-19 and beat it!

    This is my story on how I got COVID-19. And recovered without infecting anyone else in my family. So if I missed your birthday, didn't call, ignored your emails etc. - now you know why! I'm putting this down in a blog...

    Sid Shaytay7 min read
  • Living

    Modern online safety for parents of young kids

    April 2020. The ongoing global corona virus pandemic has affected everyone in far too many ways. We're not getting into the broader discussion but kids are now learning remotely over connected devices so today I'll be...

    Sid Shaytay6 min read