SSH Configuration
SSH (Secure Shell) allows secure authentication and communication with remote systems. This guide walks you through setting up SSH keys for authentication.
Generating SSH Keys
SSH keys provide a secure authentication method. We’ll use the modern Ed25519 algorithm for strong security and small key size.
Silent Key Generation
Generate SSH keys automatically without prompts. This will create or overwrite
~/.ssh/id_ed25519 (private key) and ~/.ssh/id_ed25519.pub (public key):
ssh-keygen -q -t ed25519 -N '' <<< $'\ny' >/dev/null 2>&1
Interactive Key Generation
Alternatively, generate keys interactively with prompts for passphrase and file location:
ssh-keygen -t ed25519
Verifying SSH Keys
Check if your private key exists:
test -f ~/.ssh/id_ed25519 && echo "Private key exists" || echo "Private key not found"
Check if your public key exists:
test -f ~/.ssh/id_ed25519.pub && echo "Public key exists" || echo "Public key not found"
Next Steps
After generating your SSH keys:
- Add your public key (
~/.ssh/id_ed25519.pub) to your GitHub account or other remote systems - Use your private key for secure authentication to remote servers
- Consider adding a passphrase to your SSH key for additional security