Manage SSH Keys for Windows Users
Check existing SSH keys
- Open File Explorer.
- Access your Local Disk.
- Open the
Usersfolder. - Open your profile folder.
- Open the
.sshfolder.
You can also use Git Bash to check existing SSH keys. Run the following command:
ls -al ~/.ssh
If you do not find the .ssh folder or do not see any files—like id_ed25519 and id_ed25519.pub—you do not have any keys yet.
Generate your first SSH key
Follow these steps:
Open Git Bash.
Type the following command and type your GitHub email address:
ssh-keygen -t ed25519 -C "your_email@example.com"Press Enter when prompted the following:
> Enter file in which to save the key (/c/Users/YOU/.ssh/id_ed25519): [Press enter]To leave the passphrase empty for easy use, press Enter.
> Enter passphrase (empty for no passphrase): [Press Enter] > Enter same passphrase again: [Press Enter]
Connect your SSH key to your GitHub account
Follow these steps:
Open Git Bash.
Copy your SSH public key.
clip < ~/.ssh/id_ed25519.pubOpen your browser.
Open your SSH and GPG keys page.
Add new SSH key.
Fill the title input with Personal.
Leave the Key type to be Authentication key.
Paste your SSH public key in the Key text area.
Add your new key.
Type your GitHub password.
To test whether you can connect your SSH key with GitHub, follow these steps:
Open Git Bash.
Run the following command:
ssh -T git@github.comAfter you run it, you get the following:
Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
Generate another SSH key
Follow these steps:
Open Git Bash.
Type the following command and type your GitHub email address:
ssh-keygen -t ed25519 -C "your_email@example.com"Change the filename without any extension.
> Enter file in which to save the key (/c/Users/YOU/.ssh/id_ed25519): [Type custom filename]To leave the passphrase empty for easy use, press Enter key:
> Enter passphrase (empty for no passphrase): [Press Enter] > Enter same passphrase again: [Press Enter]Open File Explorer.
Go to
C:\Users\YOU\.ssh.Replace
YOUwith your current profile name.Find the custom filename you typed before.
If your custom filename is
jack, findjackandjack.pub.
Repeat the above steps to make as many SSH keys as you like.
Connect another SSH key
Open Git Bash.
Copy your new SSH public key.
clip < ~/.ssh/jack.pubOpen your browser.
Open your SSH and GPG keys page.
Add new SSH key.
Fill the title input with Work.
Leave the Key type to be Authentication key.
Paste your SSH public key in the Key text area.
Add your new key.
Type your GitHub password.
To test whether you can connect your SSH key with GitHub, follow these steps:
Open Git Bash.
Run the following command:
ssh -i ~/.ssh/jack -T git@github.comNotice that this command refers to a specific SSH key.
After you run it, you get the following:
Hi USERNAME! You've successfully authenticated, but GitHub does not provide shell access.
Connect the local Git repository to a specific SSH key
Open a local Git repository.
Run the following command:
git config --local core.sshCommand "ssh -i ~/.ssh/CUSTOM_KEY"Do not add
.pub.
You can do the same without using the Git command by using your text editor.
- Open File Explorer.
- Open a local Git repository.
- Open the
.gitfolder inside your working directory. - Open the
configfile with Notepad. - Add
sshCommand= "ssh -i ~/.ssh/CUSTOM_KEY"inside[core]. - Save the file.
To test this, make local changes and push them to a remote repository.
Share your thoughtsTopic(s).
Thank you for reading this Manage SSH Keys for Windows Users. You can subscribe to all my articles with the Articles RSS. If you have a positive or negative comment, please send me an email or contact me through one of my social media accounts.
Share with your network
Copy this link and send it to great people only.
https://vanzasetia.xyz/blog/ssh-windows/
For you
Redesigning: Improving the Initial Prototype
The second part shows you how to develop prototype components and compose them into web pages.
By Vanza Setia
Alternative Text for Informative Images Must Be Clear
Learn how to write helpful alternative text so your users do not miss your message. Helpful alternative text is for everyone, including users without significant disabilities.
By Vanza Setia