Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
How to Add SSH Public Keys on GitHub
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
Adding SSH public keys to your GitHub account is an important step if you want to authenticate with GitHub via SSH. This allows you to securely interact with GitHub without having to enter your username and password every time. Here are the steps to add SSH public keys to your GitHub account: Step 1: Generate SSH key pair First, you need to generate a new SSH key pair on your local machine. You can do this by running the following command in your terminal: ``` ssh-keygen -t rsa -b 4096 -C "your_email@example.com" ``` This will generate a new SSH key pair using RSA encryption with a key size of 4096 bits. You can specify a different email address if you prefer. Step 2: Add public key to GitHub Once you have generated your SSH key pair, you need to add the public key to your GitHub account. To do this, follow these steps: 1. Log in to your GitHub account and click on your profile picture in the top-right corner of the screen. 2. Click on "Settings" from the drop-down menu. 3. On the left-hand side of the screen, click on "SSH and GPG keys". 4. Click on "New SSH key". 5. Enter a title for your SSH key (e.g. "My laptop"). 6. Copy the contents of your public key file (usually `~/.ssh/id_rsa.pub`) and paste it into the "Key" field. 7. Click on "Add SSH key". Step 3: Test your SSH connection To make sure that your SSH connection is working correctly, you can try to connect to GitHub using SSH. To do this, run the following command in your terminal: ``` ssh -T git@github.com ``` If everything is working correctly, you should see a message that says "Hi username! You've successfully authenticated, but GitHub does not provide shell access." where "username" is your GitHub username. That's it! You have now added your SSH public key to your GitHub account and can use SSH to interact with GitHub securely.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)