The Complete Guide to Generate SSH Key Pairs (Ed25519 & RSA)
Whether you need a direct generate ssh key github workflow, configure a production Linux cluster, or set up secure authentication on Windows, macOS, or Ubuntu, having a dependable SSH key generator is essential for modern software development and systems engineering.
What Is an SSH Key and How Does an SSH Key Generator Work?
An SSH (Secure Shell) key is an access credential used by the SSH protocol to securely authenticate users and systems without transmitting plain-text passwords over an untrusted network. When you generate SSH key pair credentials, the system creates two mathematically bound cryptographic files:
Private Key (Identity)
Remains strictly on your local computer or workstation (~/.ssh/id_ed25519 or ~/.ssh/id_rsa). It should never be shared, uploaded, or exposed. It acts as the digital secret that proves your ownership of the matching public key.
Public Key (Lock)
When you generate SSH public key credentials (id_ed25519.pub), this file is uploaded to external destinations such as GitHub, GitLab, Bitbucket, AWS EC2, or appended to ~/.ssh/authorized_keys on remote servers.
When authenticating, the server encrypts a challenge message with your public key, and only your private key can mathematically decrypt it to verify your identity. Because this browser-based SSH key generator leverages the native Web Crypto API and client-side JavaScript, the cryptographic key generation happens completely in your browser's private memory—ensuring your private keys are never transmitted to any third-party server.
Why You Should Generate Ed25519 SSH Key Pairs in 2026
Historically, RSA (Rivest–Shamir–Adleman) was the default algorithm for SSH connections. However, modern security engineering strongly advocates to generate SSH key Ed25519 pairs for virtually all new infrastructure. Ed25519 relies on Edwards-curve Digital Signature Algorithm (EdDSA) over Curve25519, offering significant architectural advantages:
- Superior Security with Compact Size: A 256-bit Ed25519 key delivers approximately 128 bits of symmetric security, which outperforms a legacy 2048-bit RSA key and rivals a heavy 4096-bit RSA key. The public key is only 68 characters long, making it easy to paste without formatting errors.
- Blazing Performance: When you generate ed25519 ssh key files, signature creation and cryptographic verification happen up to 10 times faster than RSA, significantly reducing SSH connection latency and CPU overhead on busy servers.
- Constant-Time Operation: Unlike RSA and older ECDSA curves, Ed25519 was designed specifically to be constant-time, granting inherent immunity against side-channel and cache-timing attacks.
- Universal Modern Adoption: Supported by OpenSSH 6.5+ (shipped in 2014), GitHub, GitLab, Bitbucket, Ubuntu, Debian, Fedora, Arch Linux, and macOS.
You should generally only choose RSA if you are required to support legacy hardware appliances, enterprise firewalls, or archaic Linux distributions that have not been updated in over a decade.
How to Generate SSH Key on Windows, Mac, Linux, and Ubuntu
While our online ssh key generator allows you to create keys instantly with one click, understanding how to generate ssh key pairs natively from your terminal is an essential developer skill. Here are the exact command equivalents across each major operating system:
Generate SSH Key Windows (10/11 & PowerShell)
WindowsWindows 10 and 11 feature a built-in OpenSSH Client. Open PowerShell or Windows Terminal and execute:
ssh-keygen -t ed25519 -C "your_email@example.com"
Keys will be stored under C:\Users\username\.ssh\id_ed25519. To copy your public key to clipboard:
Get-Content ~/.ssh/id_ed25519.pub | Set-Clipboard
Generate SSH Key Mac (macOS Terminal)
macOSTo generate ssh key mac users can open the Terminal.app (Command + Space > Terminal) and enter:
ssh-keygen -t ed25519 -C "your_email@example.com"
Copy your public key directly to your macOS clipboard with pbcopy:
pbcopy < ~/.ssh/id_ed25519.pub
Generate SSH Key Linux (Debian, RHEL, Arch)
LinuxTo generate ssh key linux administrators use the standard OpenSSH suite present on nearly every distribution:
ssh-keygen -t ed25519 -C "admin@yourdomain.com"
Copy public key to a remote server using ssh-copy-id:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@server_ip
Generate SSH Key Ubuntu (20.04, 22.04, 24.04 LTS)
UbuntuOn Ubuntu, you can ensure OpenSSH is installed and generate ssh key ubuntu commands in seconds:
sudo apt update && sudo apt install -y openssh-client ssh-keygen -t ed25519 -C "ubuntu-user@server"
Always verify that permissions on your private key are strictly locked:
chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_ed25519
How to Git Generate SSH Key Credentials for GitHub & GitLab
Password authentication over HTTPS for Git was deprecated by GitHub in August 2021. Today, developers must use personal access tokens or git generate ssh key authentication. SSH keys are the preferred industry standard because they never expire unless revoked, work smoothly with background Git operations, and can be easily managed through SSH agents.
Generate SSH Key for GitHub
- Use the generator above to create an Ed25519 key pair.
- Click Copy Public Key.
- In GitHub, click your profile icon > Settings > SSH and GPG keys.
- Click New SSH Key, enter a descriptive title, select Authentication Key, and paste.
- Verify your authentication:
ssh -T git@github.com
Generate SSH Key for GitLab
- To gitlab generate ssh key pairs, select Ed25519 with your GitLab email comment.
- Copy the generated public key.
- In GitLab, go to Preferences (or User Settings) > SSH Keys.
- Paste your key into the text field, select an optional expiration date, and click Add key.
- Verify your connection:
ssh -T git@gitlab.com
Enterprise Best Practices for SSH Key Pair Security
Generating an SSH key is only the first step; maintaining proper cryptographic hygiene protects your company's servers and source code repositories from compromise. Keep the following rules in mind:
Never copy your private key between machines. Generate an independent key pair on your work laptop, home desktop, and CI servers. This prevents lateral movement if one machine is lost or compromised.
Always protect interactive developer private keys with a passphrase. Our tool enables AES-256-CTR encryption with bcrypt key derivation so your key file is secure even if an attacker steals your disk backup.
Regularly inspect the ~/.ssh/authorized_keys file on production servers. Remove stale keys from employees who have departed or systems that have been decommissioned.