Using ssh-agent with Windows Subsystem for Linux

Update: I’ve since revised these instructions in this post.

This is fairly basic, but you never know what might be useful to somebody!

Due to the fact that WSL doesn’t bootstrap itself with a normal init/systemd process it can be a bit frustrating to work with SSH keys.

Thankfully the ssh-agent command is designed to set up an environment for key management without much hassle. The trivial method of doing this is to insert the following command into your ~/.bashrc or ~/.profile script:

# start ssh-agent
eval `ssh-agent`

This will initialize a socket to manage your keys and you can then use the ssh-add command as you would on a normal Linux system.

For completeness, stick the following in your ~/.bash_logout script:

# unset ssh-agent
ssh-agent -k

This will remove the socket and unset the environment so that your keys don’t remain loaded after you close your WSL session using exit or CTRL-D.

NPR Throughline – The Forgotten War

I just listened to the recent NPR Throughline podcast called The Forgotten War (S1:E03).

It’s an excellent summary of North Korea’s geopolitical history and how it relates to today’s news. I don’t think there’s anything that I would call new (if you’re interested in the topic), but it’s an excellent introduction that presents a reasonably serious overview of the topic without being heavy handed or simply propaganda.

I’m going to listen to the other podcasts this week, but so far I’m impressed at their choices of topics and this first episode (for me, third episode overall).