Skip to content

Instantly share code, notes, and snippets.

@Vlasterx
Created November 2, 2024 13:37
Show Gist options
  • Save Vlasterx/58e096a9b90a1cde15abcb34a8799cfe to your computer and use it in GitHub Desktop.
Save Vlasterx/58e096a9b90a1cde15abcb34a8799cfe to your computer and use it in GitHub Desktop.
Adding SSH keys to Windows SSH client

Install Open SSH client

To enable SSH functionality in Windows 11, follow these steps:

Open Settings: Press Win + I to open the Settings app.

Go to Apps: Navigate to Apps > Optional features.

Add an Optional Feature: Scroll down and click on View features under the "Add an optional feature" section.

Search for OpenSSH: In the search box, type OpenSSH and you should see two options:

  • OpenSSH Client
  • OpenSSH Server

Install OpenSSH Client: Check the box next to OpenSSH Client and click Next, then click Install.

Verify Installation: Open a terminal (Command Prompt or PowerShell) and type:

ssh

You should see the SSH command usage information, indicating that SSH is installed and available.

Generating keys

  1. Open Powershell and type
ssh-keygen -t rsa -b 4096 -C "[email protected]"

Follow the instructions and save the key to a default location

  1. Start the SSH Agent: In PowerShell, start the SSH agent:
Start-Service ssh-agent

IF the service cannot be started, open Powershell as admin and type

Get-Service -Name ssh-agent | Set-Service -StartupType Manual

and then start the service again

Start-Service ssh-agent
  1. Add Your SSH Key to the SSH Agent: Run the following command to add your SSH private key to the SSH agent:
ssh-add $env:USERPROFILE\.ssh\id_rsa
  1. Add the SSH Key to Your GitHub Account:
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | clip

Save contents to a new Github SSH key.

  1. Test the connection
ssh -T [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment