To set up SSH access, first check for an existing key, create or select a key pair your service supports, protect the private key with a passphrase, load it into an agent if useful, and add only the public key to your account or server. Then test the connection and keep track of which key belongs to which device and purpose. The commands below are OpenSSH examples; account steps and supported algorithms depend on the service and your operating system.
Before you create a key, check what you already have
Creating another key is not always necessary. An existing pair may already be suitable, and generating a key under a filename that exists can overwrite it. GitHub recommends checking for existing keys first; see its guide to checking for SSH keys. If you do not know what an existing key is used for, do not overwrite it. Choose a new filename when generating a separate pair.
As an Amazon Associate I earn from qualifying purchases.
A key pair has two parts: the private key remains on your computer, while the public key is registered with the service or server you want to access. Never upload or send the private key.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteChoose an algorithm the service and client support
For GitHub’s documented OpenSSH workflow, the default example uses Ed25519. The guide gives RSA with a 4096-bit key as an option for legacy systems that do not support Ed25519. These are examples for that workflow, not a guarantee that every server or client accepts both. Check your target service’s current requirements before choosing.
#1 Best Overall
- POWERFUL SECURITY KEY: The Security Key C NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key C NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key C NFC via USB-C and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Generate an Ed25519 key
- Open a terminal and run
ssh-keygen -t ed25519 -C "[email protected]", replacing the example email with an identifier you recognize. - When prompted for a file location, accept the default only if it will not overwrite a key you need. Otherwise, enter a distinct path and filename.
- Set a passphrase when prompted. Keep the resulting private key on this device.
Generate an RSA key for a legacy system
If the client or system does not support Ed25519, GitHub’s guide gives this example: ssh-keygen -t rsa -b 4096. Confirm that RSA is accepted by the service you are connecting to.
For GitHub’s full command flow and platform-specific notes, consult Generating a new SSH key and adding it to the ssh-agent.
Rank #2
- POWERFUL SECURITY KEY: The YubiKey 5C NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5C NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5C NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Protect the private key with a passphrase
A passphrase adds protection if someone gains access to the computer holding the private key. It is separate from your account password, and it does not make the key safe to share. GitHub explains the role of a passphrase in its SSH key passphrase guide.
You can change the passphrase on an existing key without creating a new pair. For the default Ed25519 path, run ssh-keygen -p -f ~/.ssh/id_ed25519. Substitute the actual private-key path if you used a different filename.
Rank #3
- POWERFUL SECURITY KEY: The YubiKey 5 NFC is the most versatile physical passkey, protecting your digital life from phishing attacks. It ensures only you can access your accounts
- WORKS WITH 1000+ ACCOUNTS: Compatible with popular accounts like Google, Microsoft, and Apple. A single YubiKey 5 NFC secures 100+ of your favorite accounts, including email, password managers, and more
- FAST & CONVENIENT LOGIN: Plug in your YubiKey 5 NFC via USB and tap it, or tap it against your phone (NFC), to authenticate. No batteries, no internet connection, and no extra fees required
- MOST SECURE PASSKEY: Supports FIDO2/WebAuthn, FIDO U2F, Yubico OTP, OATH-TOTP/HOTP, Smart card (PIV), and OpenPGP. That means it’s versatile, working almost anywhere you need it
- PRIMARY & SPARE KEYS: Just like having a spare house key, we recommend buying two YubiKeys - one for daily use and one as a spare. That way you’ll never get locked out of your accounts
Use ssh-agent to reduce repeated passphrase prompts
ssh-agent can hold an unlocked key for use by SSH clients, so you do not need to enter its passphrase for every operation. It does not replace a passphrase or change where the private key should be stored.
Agent startup and key loading differ by platform. GitHub’s setup guide has separate instructions for macOS Keychain integration, Windows OpenSSH service setup, and Unix-like systems. Follow the section matching your environment rather than treating one startup command as universal. On Windows, Git for Windows may use its bundled ssh.exe, which can fail to communicate with keys held by the Windows OpenSSH agent; GitHub documents configuring Git to use the system SSH binary in that situation.
Rank #4
- POWERFUL SECURITY KEY: The Security Key NFC is the essential physical passkey for protecting your digital life from phishing attacks. It ensures only you can access your accounts.
- WORKS WITH 1000+ ACCOUNTS: Compatible with Google, Microsoft, and Apple. A single Security Key NFC secures 100 of your favorite accounts, including email, password managers, and more.
- FAST & CONVENIENT LOGIN: Plug in your Security Key NFC via USB-A and tap it, or tap it against your phone (NFC) to authenticate. No batteries, no internet connection, and no extra fees required.
- TRUSTED PASSKEY TECHNOLOGY: Uses the latest passkey standards (FIDO2/WebAuthn & FIDO U2F) but does not support One-Time Passwords. For complex needs, check out the YubiKey 5 Series.
- BUILT TO LAST: Made from tough, waterproof, and crush-resistant materials. Manufactured in Sweden and programmed in the USA with the highest security standards.
Register the public key with the service
For GitHub, the public key must be added to your GitHub account before it can authorize SSH access. The public key is typically the file with the .pub suffix; the private key has no such suffix by default. Use GitHub’s instructions for adding a new SSH key and follow the service’s current account interface. For another hosting service or server, use its own public-key registration procedure.
Test access and identify the key you are using
After registration, test the connection using the target service’s current instructions. If access fails, establish which SSH executable and agent your shell or Git client is using, then compare the local key or fingerprint with the key registered to the account. A mismatch between the SSH binary and agent can make an otherwise correctly registered key appear unavailable.
Best Value
- Security Key : Protect your online accounts against unauthorized access by using FIDO2 and U2F authentication with T110. It's the world's most protective security key that works with windows, Mac OS, Linux as well as Chrome, Firefox, Edge and many other major browsers.
- Certified with the new FIDO2 standard, T110 provides the benefit of fast login and strong protection against phishing, account takeover as well as many other online attactks.
- Works with : Bank of America, Github, Google, Microsoft, DUO, Twitter, Facebook, Dropbox, Apple, ebay, BINANCE, mor and more.
- Fits USB-A port : Insert the T110 security key into the USB-A port of each service and log in conveniently with one touch
- For the driver download and user guide, please visit TrustKey Solutions Home support page.
A SHA-256 fingerprint identifies a key without revealing the private key. To list fingerprints available to the agent, run ssh-add -l -E sha256. Compare the result with the account’s key listing, and keep a record of the machine and purpose for each key.
Review, remove, or replace keys as circumstances change
Review the keys registered to your account periodically. Remove entries you do not recognize, no longer use, or no longer trust; treat a compromised key as untrusted and revoke it promptly. GitHub’s key review guidance explains how to inspect associated keys. A fingerprint helps you identify which key an entry represents without exposing its private contents.
Consider hardware-backed keys only if your setup supports them
OpenSSH supports hardware-backed key types such as ed25519-sk; GitHub also documents ecdsa-sk for hardware that does not support Ed25519. The physical security key must be connected when authenticating. Compatibility depends on the security key, OpenSSH build, operating system, and target service, so verify all of those before relying on this route.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




