Generate a proper ed25519 key, wire it into the ssh-agent, upload it to GitHub, and never type a password again. Pick your distro.
HTTPS asks for your credentials on every push. SSH authenticates silently with a key pair — set it up once, forget about it forever.
ls -al ~/.ssh
~/.ssh doesn't exist yet, that's fine — ssh-keygen will create it automatically.ssh-keygen -t ed25519 -C "you@example.com"
~/.ssh/id_ed25519). Add a passphrase for extra security — you'll only type it once per session thanks to ssh-agent.# Start the agent eval "$(ssh-agent -s)" # Register your key ssh-add ~/.ssh/id_ed25519
systemctl --user enable --now ssh-agent, then add export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" to your ~/.zshrc.# Install xclip (X11) or wl-clipboard (Wayland) sudo dnf install -y xclip # Copy to clipboard — X11 cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Or if you're on Wayland (common on Fedora 43+) sudo dnf install -y wl-clipboard cat ~/.ssh/id_ed25519.pub | wl-copy
echo $XDG_SESSION_TYPE. If it says wayland, use wl-copy.ssh-ed25519 and end with your email address.ssh -T git@github.com
If everything is wired up correctly you'll see:
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
All git operations over SSH URLs will now authenticate silently.
# Personal account Host github.com HostName github.com User git IdentityFile ~/.ssh/id_ed25519 # Work account Host github-work HostName github.com User git IdentityFile ~/.ssh/id_ed25519_work
git clone git@github-work:ORG/REPO.git# 1. Generate key ssh-keygen -t ed25519 -C "you@example.com" # 2. Start agent + add key eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 # 3. Install clipboard tool + copy public key sudo dnf install -y xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # (Wayland: sudo dnf install -y wl-clipboard && cat ~/.ssh/id_ed25519.pub | wl-copy) # 4. Paste into github.com → Settings → SSH and GPG keys # 5. Test ssh -T git@github.com
ls -al ~/.ssh
id_ed25519.pub or id_rsa.pub, you already have a key. Skip to step 3.ssh-keygen -t ed25519 -C "you@example.com"
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519
eval "$(ssh-agent -s)" and ssh-add ~/.ssh/id_ed25519 to your ~/.bashrc or ~/.zshrc.# Install xclip sudo apt install -y xclip # Copy to clipboard — X11 cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Or on Wayland (Ubuntu 22.04+) sudo apt install -y wl-clipboard cat ~/.ssh/id_ed25519.pub | wl-copy
echo $XDG_SESSION_TYPE. Ubuntu 22.04+ defaults to Wayland on supported hardware.ssh-ed25519 and end with your email — no extra whitespace.ssh -T git@github.com
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
ssh-keygen -t ed25519 -C "you@example.com" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 sudo apt install -y xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Paste into github.com → Settings → SSH and GPG keys ssh -T git@github.com
ls -al ~/.ssh
id_ed25519.pub or id_rsa.pub, you already have a key. Skip to step 3.ssh-keygen -t ed25519 -C "you@example.com"
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519
openssh-client. If ssh-keygen -t ed25519 fails, run sudo apt install -y openssh-client to ensure you have a current version.# Install xclip sudo apt install -y xclip # Copy to clipboard cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # No clipboard tool available? Just print and copy manually: cat ~/.ssh/id_ed25519.pub
ssh-ed25519 and end with your email — no extra whitespace.ssh -T git@github.com
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
ssh-keygen -t ed25519 -C "you@example.com" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 sudo apt install -y xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Paste into github.com → Settings → SSH and GPG keys ssh -T git@github.com
ls -al ~/.ssh
id_ed25519.pub or id_rsa.pub, skip to step 3.ssh-keygen -t ed25519 -C "you@example.com"
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519
systemctl --user enable --now ssh-agent and set SSH_AUTH_SOCK in your shell config. Alternatively, KDE Wallet and GNOME Keyring both handle this automatically if you're using a full desktop.# X11 sudo pacman -S xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Wayland sudo pacman -S wl-clipboard cat ~/.ssh/id_ed25519.pub | wl-copy
ssh-ed25519 and end with your email — no extra whitespace.ssh -T git@github.com
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
ssh-keygen -t ed25519 -C "you@example.com" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 sudo pacman -S xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Paste into github.com → Settings → SSH and GPG keys ssh -T git@github.com
ls -al ~/.ssh
id_ed25519.pub or id_rsa.pub, skip to step 3.ssh-keygen -t ed25519 -C "you@example.com"
eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519
sudo apt install -y xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard
~/.ssh/id_ed25519.pub in a text editor and select all → copy. The result is the same.ssh-ed25519 and end with your email — no extra whitespace.ssh -T git@github.com
Hi username! You've successfully authenticated,
but GitHub does not provide shell access.
ssh-keygen -t ed25519 -C "you@example.com" eval "$(ssh-agent -s)" ssh-add ~/.ssh/id_ed25519 sudo apt install -y xclip cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Paste into github.com → Settings → SSH and GPG keys ssh -T git@github.com
ssh-add -l — if it returns "The agent has no identities", run ssh-add ~/.ssh/id_ed25519. (2) Did you add the public key (.pub) to GitHub, not the private one? (3) Is your remote URL using SSH, not HTTPS? Check with git remote -v — it should start with git@github.com, not https://.eval "$(ssh-agent -s)" followed by ssh-add ~/.ssh/id_ed25519. To make this permanent on Fedora, enable the systemd user socket: systemctl --user enable --now ssh-agent and add export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket" to your ~/.zshrc. On Ubuntu/Mint, GNOME Keyring usually handles this automatically.git remote -v. If you see https://github.com/..., update it: git remote set-url origin git@github.com:USER/REPO.git. Replace USER and REPO with your actual GitHub username and repository name.~/.ssh/known_hosts file, or it changed. The safest fix: run ssh-keyscan github.com >> ~/.ssh/known_hosts to add the current key. Then retry. If you've connected before and it's suddenly changed, that's worth investigating before proceeding.ssh -vT git@github.com and look for the "Offering public key" line. To fix, set up a ~/.ssh/config file (see the bonus step in any distro panel above) mapping different host aliases to different keys, then update your remote URL to use the alias: git remote set-url origin git@github-work:ORG/REPO.git.