Skip to content

Instantly share code, notes, and snippets.

@soediro
Created May 29, 2026 13:55
Show Gist options
  • Select an option

  • Save soediro/6021884493679157f92dec4fe487a1b3 to your computer and use it in GitHub Desktop.

Select an option

Save soediro/6021884493679157f92dec4fe487a1b3 to your computer and use it in GitHub Desktop.
SSH Key
# 1️⃣ Generate key (ed25519, 100 KDF rounds)
ssh-keygen -t ed25519 -a 100 -C "your-email@example.com"

# 2️⃣ Ensure ssh-agent is running and add the key
systemctl --user enable --now ssh-agent.service
ssh-add ~/.ssh/id_ed25519

# 3️⃣ Copy public key to a remote host (replace user@host)
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host

# 4️⃣ (Optional) Add a host entry to ~/.ssh/config
cat <<'EOF' >> ~/.ssh/config
Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519
    IdentitiesOnly yes
EOF

# 5️⃣ Test
ssh -T git@github.com
git clone git@github.com:username/repo.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment