{"id":1227,"date":"2017-07-07T16:10:07","date_gmt":"2017-07-07T16:10:07","guid":{"rendered":"http:\/\/www.testingdocs.com\/questions\/?p=1227"},"modified":"2021-03-20T13:21:41","modified_gmt":"2021-03-20T13:21:41","slug":"how-to-connect-to-github-using-ssh","status":"publish","type":"post","link":"https:\/\/www.testingdocs.com\/questions\/how-to-connect-to-github-using-ssh\/","title":{"rendered":"How to connect to GitHub using SSH?"},"content":{"rendered":"<h3>Introduction<\/h3>\n<p>We can connect to GitHub servers using SSH keys. Using the SSH, you can connect and authenticate to remote GitHub in a secure way. With SSH keys, you can connect to GitHub without supplying your username\/password every time you interact. The picture below shows the ssh communication between client and server using Putty.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-900\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/ssh-communication-1.png\" alt=\"ssh communication\" width=\"901\" height=\"476\" title=\"\"><\/p>\n<p>&nbsp;<\/p>\n<h3><strong>Generate SSH key<\/strong><\/h3>\n<p>If you do not have any existing keys you can generate one using the OpenSSH command. On Windows 10 platform, you can find the ssh keys under the below folder:<\/p>\n<p><strong>C:\\Users\\&lt;username&gt;\\.ssh<\/strong><\/p>\n<p>Once you&#8217;ve checked for existing SSH keys, if none exists, you can generate a new SSH key.<\/p>\n<p><strong>ssh-keygen -t rsa -b 4096 -C &#8220;&lt;username_at_github&gt;&#8221;<\/strong><\/p>\n<p>Note: remove the placeholders &lt; and &gt; in the original command that you issue.<\/p>\n<p>When you&#8217;re prompted to &#8220;Enter a file in which to save the key,&#8221; press Enter.<\/p>\n<p>At the prompt, type your secure passphrase and confirm it.<\/p>\n<h3><strong>Adding the key to GitHub account<\/strong><\/h3>\n<p>To configure your GitHub account to use your new or existing SSH key, you&#8217;ll need to add it to your GitHub account as shown in the below screen.<\/p>\n<p>Go to your Profile <strong>Settings &gt;&gt; SSH and GPG keys<\/strong><\/p>\n<p>Click on <strong>the New SSH key<\/strong> button to add.<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-901\" src=\"http:\/\/www.testingdocs.com\/questions\/wp-content\/uploads\/Adding-SSH-Keys-to-GitHub-Account.jpeg\" alt=\"Adding SSH Keys to GitHub Account\" width=\"1365\" height=\"648\" title=\"\"><\/p>\n<p>&nbsp;<\/p>\n<p>Enter the title and the key and click on <strong>Add SSH key<\/strong> button.\u00a0 The key usually starts with ssh-rsa since we have used RSA Encryption algorithm.<\/p>\n<p>That&#8217;s it. You are done with adding the key to your GitHub account. You can test the communication by launching Git Bash and perform some action like pushing some stuff to your repository.<\/p>\n<!--themify_builder_content-->\n<div id=\"themify_builder_content-1227\" data-postid=\"1227\" class=\"themify_builder_content themify_builder_content-1227 themify_builder tf_clear\">\n    <\/div>\n<!--\/themify_builder_content-->\n","protected":false},"excerpt":{"rendered":"<p>Introduction We can connect to GitHub servers using SSH keys. Using the SSH, you can connect and authenticate to remote GitHub in a secure way. With SSH keys, you can connect to GitHub without supplying your username\/password every time you interact. The picture below shows the ssh communication between client and server using Putty. &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[32],"class_list":["post-1227","post","type-post","status-publish","format-standard","hentry","category-git","tag-git","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"_links":{"self":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/comments?post=1227"}],"version-history":[{"count":3,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1227\/revisions"}],"predecessor-version":[{"id":19566,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/posts\/1227\/revisions\/19566"}],"wp:attachment":[{"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/media?parent=1227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/categories?post=1227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.testingdocs.com\/questions\/wp-json\/wp\/v2\/tags?post=1227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}