{"id":20455182,"url":"https://github.com/rahulbhoyar1995/adding-ssh-key-to-github-tutorial","last_synced_at":"2026-06-06T00:31:36.314Z","repository":{"id":233256145,"uuid":"786355876","full_name":"rahulbhoyar1995/Adding-SSH-Key-to-Github-Tutorial","owner":"rahulbhoyar1995","description":"Comprehensive tutorial for adding SSH keys to your GitHub account, enhancing security and facilitating seamless authentication. Simple steps for beginners and advanced users alike.","archived":false,"fork":false,"pushed_at":"2024-04-14T08:06:41.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T10:19:38.849Z","etag":null,"topics":["github","ssh-key","ssh-server"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahulbhoyar1995.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-14T07:44:02.000Z","updated_at":"2024-04-14T08:09:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"390173e3-88c4-4f81-925a-db6268b489ba","html_url":"https://github.com/rahulbhoyar1995/Adding-SSH-Key-to-Github-Tutorial","commit_stats":null,"previous_names":["rahulbhoyar1995/adding-ssh-key-to-github-tutorial"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahulbhoyar1995/Adding-SSH-Key-to-Github-Tutorial","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulbhoyar1995%2FAdding-SSH-Key-to-Github-Tutorial","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulbhoyar1995%2FAdding-SSH-Key-to-Github-Tutorial/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulbhoyar1995%2FAdding-SSH-Key-to-Github-Tutorial/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulbhoyar1995%2FAdding-SSH-Key-to-Github-Tutorial/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahulbhoyar1995","download_url":"https://codeload.github.com/rahulbhoyar1995/Adding-SSH-Key-to-Github-Tutorial/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahulbhoyar1995%2FAdding-SSH-Key-to-Github-Tutorial/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33965591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-05T02:00:06.157Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github","ssh-key","ssh-server"],"created_at":"2024-11-15T11:18:09.077Z","updated_at":"2026-06-06T00:31:36.299Z","avatar_url":"https://github.com/rahulbhoyar1995.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Adding SSH Key to Github Tutorial\n\n### Author : Rahul Bhoyar\n\nSetting up an SSH key for your GitHub account is like giving your computer a special secret handshake to securely communicate with GitHub. It's important because it adds an extra layer of security by ensuring that only your computer, with the correct key, can access your GitHub account. This helps prevent unauthorized access and keeps your account and data safe from potential threats. Additionally, using an SSH key makes it easier to connect to GitHub repositories without having to repeatedly enter your username and password, saving you time and hassle. Overall, it's a simple but effective way to protect your GitHub account and streamline your workflow.\n\nIn this tutorial, we shall learn how to set up a SSH key to your Github account in simple steps.\n\n### (A) For iOS\n#### Step 1: Check for Existing SSH Keys\n\nBefore generating a new SSH key, let's check if you already have one. Open Terminal on your Macbook and type the following command:\n\n```\nls -al ~/.ssh\n```\n\nLook for files named id_rsa and id_rsa.pub. If these files exist, you already have an SSH key and can skip to Step 3. Otherwise, proceed to Step 2.\n\n#### Step 2: Generate a New SSH Key\n\nTo generate a new SSH key, type the following command in Terminal:\n```\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n```\nReplace \"your_email@example.com\" with the email associated with your GitHub account. Press Enter to accept the default file location (~/.ssh/id_rsa) and to leave the passphrase empty if you don't want to use one.\n\n#### Step 3: Add SSH Key to SSH Agent\n\nRun the following command to start the SSH agent:\n```\neval \"$(ssh-agent -s)\"\n```\nThen, add your SSH key to the SSH agent:\n```\nssh-add ~/.ssh/id_rsa\n```\n#### Step 4: Add SSH Key to Your GitHub Account\n\nFirst, copy the SSH key to your clipboard using:\n```\npbcopy \u003c ~/.ssh/id_rsa.pub\n```\nNext, go to GitHub and navigate to **Settings \u003e SSH and GPG keys \u003e New SSH key**.\n\nPaste the SSH key into the \"Key\" field and give it a descriptive title.\n\n#### Step 5: Test Your SSH Connection\n\nTo ensure everything is set up correctly, run the following command in Terminal:\n```\nssh -T git@github.com\n```\nYou should see a message indicating a successful connection to GitHub.\n\n### (A) For Windows OS\n\n#### Step 1: Check for Existing SSH Keys\n\nBefore generating a new SSH key, let's check if you already have one. Open Command Prompt on your Windows PC and type the following command:\n```\ndir %userprofile%\\.ssh\n```\nLook for files named id_rsa and id_rsa.pub. If these files exist, you already have an SSH key and can skip to Step 3. Otherwise, proceed to Step 2.\n\n#### Step 2: Generate a New SSH Key\n\nTo generate a new SSH key, type the following command in Command Prompt:\n```\nssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n```\nReplace \"your_email@example.com\" with the email associated with your GitHub account. Press Enter to accept the default file location (%userprofile%\\.ssh\\id_rsa) and to leave the passphrase empty if you don't want to use one.\n\n#### Step 3: Add SSH Key to SSH Agent\n\nRun the following command to start the SSH agent:\n```\neval `ssh-agent -s`\n```\nThen, add your SSH key to the SSH agent:\n```\nssh-add %userprofile%\\.ssh\\id_rsa\n```\n\n#### Step 4: Add SSH Key to Your GitHub Account\n\nFirst, copy the SSH key to your clipboard using:\n```\nclip \u003c %userprofile%\\.ssh\\id_rsa.pub\n```\nNext, go to GitHub and navigate to Settings \u003e SSH and GPG keys \u003e New SSH key.\n\nPaste the SSH key into the \"Key\" field and give it a descriptive title.\n\n#### Step 5: Test Your SSH Connection\n\nTo ensure everything is set up correctly, run the following command in Command Prompt:\n```\nssh -T git@github.com\n```\nYou should see a message indicating a successful connection to GitHub.\n\n### Purpose of Private and Public SSH Keys :\n\n**(A) Private SSH Key:** \nThis key is kept on your local device, such as your computer. It is a closely guarded secret and should never be shared with anyone. The private key is used to authenticate your identity when you connect to a remote server, such as GitHub. It's essentially your digital signature that proves you are who you say you are.\n\n**(B) Public SSH Key:** \nOn the other hand, the public SSH key is shared with the remote server, such as GitHub. It is stored on the server and is used to verify your identity when you attempt to connect. While the public key is safe to share, as it cannot be used to gain access to your account without the corresponding private key, it plays a crucial role in the authentication process by confirming that you possess the corresponding private key.\n\nIn summary, the private SSH key is kept secret and is used for authentication on your local device, while the public SSH key is shared and stored on remote servers to verify your identity when connecting to them.\n\n\n### Cloning a Repository Using SSH\n\nOnce your SSH connection to GitHub is established, you can easily clone a repository using SSH commands. Here's how:\n\n(1) Navigate to the repository on GitHub that you want to clone.\n\n(2) Click on the green \"Code\" button and select \"SSH\" to switch to the SSH URL.\n\n(3) Copy the SSH URL provided (e.g., git@github.com:user/repository.git).\n\nOpen Command Prompt on your computer and navigate to the directory where you want to clone the repository.\n\n(4) Use the git clone command followed by the SSH URL you copied earlier. For example:\n\n```\ngit clone git@github.com:user/repository.git\n```\nReplace user/repository with the appropriate username and repository name.\n\n(5) Press Enter, and Git will clone the repository to your local machine using the SSH protocol.\n\nCongratulations! You've successfully tested your SSH connection to GitHub and cloned a repository using SSH commands. You can now work with the repository locally and push changes back to GitHub securely using SSH.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulbhoyar1995%2Fadding-ssh-key-to-github-tutorial","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahulbhoyar1995%2Fadding-ssh-key-to-github-tutorial","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahulbhoyar1995%2Fadding-ssh-key-to-github-tutorial/lists"}