Generate SSH key
Generate a new SSH key pair using the Ed25519 algorithm:
When prompted:
- Press Enter to accept the default file location
- Enter a secure passphrase (recommended) or press Enter for no passphrase
Start ssh-agent
Start the SSH agent in the background:This command starts the SSH agent and adds it to your current session.
Copy public key to clipboard
Copy your public key to the clipboard for easy pasting:
If
xclip is not installed, you can install it with sudo apt install xclip.Add key to GitHub
- Go to GitHub.com and sign in
- Click your profile picture → Settings
- Click “SSH and GPG keys” in the sidebar
- Click “New SSH key”
- Give it a descriptive title
- Paste your public key in the “Key” field
- Click “Add SSH key”
Next Steps
Now you can:- Clone repositories using SSH URLs
- Push and pull without entering passwords
- Use SSH for secure Git operations