Last active
February 27, 2024 23:48
-
-
Save M1ndBlast/968185ff963383940a6c09e8925c148b to your computer and use it in GitHub Desktop.
Unique SSH key for Windows and WSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Change your email | |
ssh-keygen -t ed25519 -C "[email protected]" | |
## 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 [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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 [email protected] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment