While a proper ~/.ssh/config
can be great, this should be a minimal way to set up new keys for using multiple accounts on Mac, Windows, and WSL, and covers some of the traps in simultaneous use of Windows AND WSL.
To connect from "this machine" to a new GH account. While ~
will be different from your windows and WSL's perspective, WSL's ~/.ssh
should be a soft link to your window's ~/.ssh
, so it's ok to use either
# Make the soft link, if it doesn't yet exist.
# Might need to mkdir if this is your first key.
YOUR_WINDOWS_USERNAME=example
mkdir -p /mnt/c/Users/$YOUR_WINDOWS_USERNAME/.ssh
ln -s /mnt/c/Users/$YOUR_WINDOWS_USERNAME/.ssh ~/.ssh