In this article, we explore how to generate and share SSH keys securely and efficiently, comparing RSA 4096-bit and Ed25519 algorithms.
To create robust keys:
# RSA 4096-bit key
ssh-keygen -t rsa -b 4096 -C "you@example.com"
# Ed25519 (256-bit)
ssh-keygen -t ed25519 -C "you@example.com"
Copy the public key to the remote server:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@remote_host
Or manually:
cat ~/.ssh/id_ed25519.pub | ssh user@remote_host "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
Well-configured SSH keys ensure encrypted communications and simplify remote access management. RSA remains valuable for legacy environments, while Ed25519 is recommended for modern deployments.