Skip to content

Instantly share code, notes, and snippets.

@M1ndBlast
Last active February 27, 2024 23:48
Show Gist options
  • Save M1ndBlast/968185ff963383940a6c09e8925c148b to your computer and use it in GitHub Desktop.
Save M1ndBlast/968185ff963383940a6c09e8925c148b to your computer and use it in GitHub Desktop.
Unique SSH key for Windows and WSL
## Change your email
ssh-keygen -t ed25519 -C "your_email@example.com"
## Verifying if ssh agent is running
# Set-Service ssh-agent -StartupType Manual
# Start-Service ssh-agent
Get-Service ssh-agent
## Adding sshkey to agent
ssh-add ~\.ssh\id_ed25519
## Adding sshkey to clipboard
cat ~\.ssh\id_ed25519.pub | clip
## then, add to github account
echo "Run sshkey_wsl.sh" on your wsl subsystem
## Verification
# ssh -T git@github.com
## Copy only private key
cp /mnt/c/Users/YOU/.ssh/id_github_ed25519 /home/YOU/.ssh/
## rw access
chmod 600 ~/.ssh/id_rsa
## r access
#chmod 400 ~/.ssh/id_rsa
## Create directory if doesn't exists
# mkdir ~/.ssh
## Adding sshkey to agent
ssh-add ~/.ssh/id_ed25519
## Finish process
echo "Done. enojoy it!"
## Verification
# ssh -T git@github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment