How to Set Up SSH Keys for GitHub, Linux, Mac, and Windows

Set up SSH keys step by step: generate a key pair, install the public key, configure ssh-agent, add keys to GitHub or GitLab, and fix common errors.

  • Setting up SSH requires generating a key pair, installing the public key, and testing the connection.
  • Do not disable password authentication until key-based login has been verified.
  • Use ssh-agent or the macOS Keychain to manage passphrases for personal keys.
Platform Setup Guides
What Is SSH? The Complete Guide to Secure Shell What Is an SSH Key? Public and Private Keys Explained SSH Command Examples: Syntax, Flags, Tunnels, and Keys How to Set Up SSH Keys for GitHub, Linux, Mac, and Windows Generate SSH Key: Online Tool and ssh-keygen Commands ssh-keygen Command: Create SSH Keys with Examples
SSH Key Generator
English 简体中文 繁體中文 日本語 한국어 Español Português Français Deutsch Русский Italiano Nederlands Polski Svenska עברית Dansk Norsk हिन्दी Tiếng Việt Türkçe Indonesia Suomi Українська العربية ไทย Română Čeština বাংলা Ελληνικά Magyar
Resources
GitHub SSH Docs GitLab SSH Docs SSH Academy SSH Cheat Sheet
How to Set Up SSH Keys for GitHub, Linux, Mac, and Windows SSH Key Generator: Generate SSH Keys Online