Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Generate SSH Keys in Windows 11

Make an SSH key pair with PowerShell in four steps.

Windows Hosting2 min read6 steps1 screenshot

Step 1: Open a terminal

Windows 11 has the OpenSSH client built in. Open PowerShell or Command Prompt (or Windows Terminal). Go to your user folder. SSH keys are saved by default in C:\Users\YourName\.ssh.

If ssh-keygen is not found, install the client in Settings, then Apps, then Optional features, then Add a feature, and add OpenSSH Client.

Step 2: Generate the key pair

ssh-keygen -t rsa -b 4096

You can use the newer ed25519 type, which is shorter and also strong:

ssh-keygen -t ed25519
  1. Press Enter to save the key in the default place.
  2. Enter a passphrase for the private key. It adds a layer of safety. You can press Enter to skip it.
  3. Wait for the process to finish. SSH tells you where your files were saved.

Step 3: Find the keys

Open File Explorer and go to C:\Users\YourName\.ssh.

The .ssh folder with the key files

You will see two files:

  • id_rsa is your private key. Keep it secret.
  • id_rsa.pub is your public key. You can share it.

Make a backup of the keys in a safe place. You can open the public key in Notepad.

Step 4: Use the keys

  1. Copy the content of the public key file (.pub). In PowerShell:
Get-Content $env:USERPROFILE\.ssh\id_rsa.pub | Set-Clipboard
  1. Add the public key to the server or service. For a Linux server, add it to ~/.ssh/authorized_keys. For GitHub or GitLab, paste it into the SSH keys page of your account.
  2. Connect with your private key:
ssh -i C:\Users\YourName\.ssh\id_rsa user@server_ip

If you set a passphrase, SSH asks for it.

Quick recap

  • Run ssh-keygen in PowerShell.
  • The public key (.pub) goes on the server, the private key stays with you.
  • Back up the keys and use a passphrase.