Using these official steps from GitHub, you will be able to generate a new SSH key, add it to the ssh-agent, and authenticate your Git operations securely.
What it does
You can access and write data in repositories on GitHub using the Secure Shell Protocol (SSH). When you connect via SSH, you authenticate using a private key file on your local machine.
Before you start
You should check for existing SSH keys before generating a new one. You will also need access to Terminal, Git Bash, or PowerShell, along with your GitHub email address.
Steps
Step 1: Open Terminal or Git Bash and paste the command ssh-keygen -t ed25519 -C "your_email@example.com" replacing the email address with your GitHub email.
Step 2: Press Enter to accept the default file location when prompted, or type a custom path if you have created keys previously.
Step 3: Type a secure passphrase when prompted, or press Enter for no passphrase.
Step 4: Start the ssh-agent in the background by running the command eval "$(ssh-agent -s)" or your environment's specific agent startup command.
Step 5: Add your SSH private key to the ssh-agent using the command ssh-add ~/.ssh/id_ed25519 or the platform-specific equivalent.
What the company says
GitHub states that you can access and write data in repositories on GitHub using SSH. GitHub also notes that it improved security by dropping older, insecure key types on March 15, 2022.
What to do
- Generate a new SSH key using ssh-keygen with your email address.
- Start the ssh-agent in the background.
- Add your SSH private key to the ssh-agent.
Key facts and where they come from
- GitHub allows users to access and write data in repositories using SSH.
You can access and write data in repositories on GitHub using SSH (Secure Shell Protocol).
- GitHub dropped older, insecure key types on March 15, 2022.
GitHub improved security by dropping older, insecure key types on March 15, 2022.
