Skip to content

Instantly share code, notes, and snippets.

@hunkardoner
hunkardoner / README.md
Created June 20, 2024 15:24 — forked from Skenvy/README.md
SSH for multiple GH accounts

SSH for multiple GH accounts

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.

Creating a new key

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