[{"data":1,"prerenderedAt":412},["ShallowReactive",2],{"en-article-\u002Fen\u002Fblog\u002Fhow-to-create-and-set-up-ssh-key-github":3,"en-related-posts-\u002Fen\u002Fblog\u002Fhow-to-create-and-set-up-ssh-key-github":304},{"id":4,"title":5,"articleCover":6,"articleCoverEmbed":7,"articleCoverEmbedUploadDate":7,"articleCoverHeight":8,"articleCoverWidth":9,"authorId":10,"body":11,"categoriesIds":289,"description":291,"enAlternateSlug":292,"extension":293,"meta":294,"navigation":295,"path":296,"ptBrAlternateSlug":297,"publishedAt":298,"seo":299,"sitemap":300,"stem":301,"updatedAt":298,"wordCount":302,"__hash__":303},"blogEn\u002Fen\u002Fblog\u002Fhow-to-create-and-set-up-ssh-key-github.md","SSH Key in Git: How to Set Up an SSH Key for GitHub","\u002Fimages\u002Fen\u002Fblog\u002Fgit\u002Fhow-to-create-and-set-up-ssh-key-github-thumb.webp",null,720,1280,"thiago-nunes-batista",{"type":12,"value":13,"toc":282},"minimark",[14,18,21,26,34,72,75,85,92,102,130,134,141,154,168,171,183,194,198,201,244,255,258,262,278],[15,16,17],"p",{},"Git is the most popular tool for version control, and GitHub is the most widely used platform for storing your code in the cloud. However, having to enter your username and password every time you interact with GitHub can be quite inconvenient.",[15,19,20],{},"This is where the SSH key comes in. The key is used to establish a secure connection between your machine and GitHub, eliminating the need to repeatedly enter your credentials. In this article, I will guide you step by step on setting up an SSH key in GitHub to optimize your workflow.",[22,23,25],"h2",{"id":24},"generating-the-ssh-key","Generating the SSH Key",[15,27,28,29,33],{},"The first step is to generate the SSH key. You can do this by running the command below to generate the SSH key. Don't forget to replace ",[30,31,32],"code",{},"codigoaoponto@email.com"," with your email registered on GitHub:",[35,36,41],"pre",{"className":37,"code":38,"language":39,"meta":40,"style":40},"language-bash shiki shiki-themes dracula","ssh-keygen -t ed25519 -C \"codigoaoponto@email.com\"\n","bash","",[30,42,43],{"__ignoreMap":40},[44,45,48,52,56,60,63,67,69],"span",{"class":46,"line":47},"line",1,[44,49,51],{"class":50},"sAOxA","ssh-keygen",[44,53,55],{"class":54},"sIQBb"," -t",[44,57,59],{"class":58},"s-mGx"," ed25519",[44,61,62],{"class":54}," -C",[44,64,66],{"class":65},"seVfx"," \"",[44,68,32],{"class":58},[44,70,71],{"class":65},"\"\n",[15,73,74],{},"During this process, you will be asked about:",[76,77,78,82],"ul",{},[79,80,81],"li",{},"Adding a password to the SSH key.",[79,83,84],{},"Changing the directory where the SSH key will be saved.",[15,86,87,88,91],{},"In this tutorial, we will not worry about these options. For both questions, you can simply press ",[30,89,90],{},"Enter",". After these two questions, the SSH key will be generated.",[15,93,94,95,98,99,101],{},"If, for some reason, you want to generate the key in ",[30,96,97],{},"rsa"," format, the command will be slightly different, but the process will be identical, also requiring just pressing ",[30,100,90],{}," for the questions:",[35,103,105],{"className":37,"code":104,"language":39,"meta":40,"style":40},"ssh-keygen -t rsa -b 4096 -C \"codigoaoponto@email.com\"\n",[30,106,107],{"__ignoreMap":40},[44,108,109,111,113,116,119,122,124,126,128],{"class":46,"line":47},[44,110,51],{"class":50},[44,112,55],{"class":54},[44,114,115],{"class":58}," rsa",[44,117,118],{"class":54}," -b",[44,120,121],{"class":54}," 4096",[44,123,62],{"class":54},[44,125,66],{"class":65},[44,127,32],{"class":58},[44,129,71],{"class":65},[22,131,133],{"id":132},"obtaining-the-generated-ssh-key","Obtaining the Generated SSH Key",[15,135,136,137,140],{},"The second step is to copy the generated SSH key, and you can do this by running the command below, where ",[30,138,139],{},"key_directory"," should be replaced with the path to the public SSH key file:",[35,142,144],{"className":37,"code":143,"language":39,"meta":40,"style":40},"cat key_directory\n",[30,145,146],{"__ignoreMap":40},[44,147,148,151],{"class":46,"line":47},[44,149,150],{"class":50},"cat",[44,152,153],{"class":58}," key_directory\n",[15,155,156,157,160,161,164,165,167],{},"If you followed all the previous tutorial steps, the SSH key was generated in the default directory: ",[30,158,159],{},"~\u002F.ssh\u002Fid_ed25519.pub"," (or ",[30,162,163],{},"~\u002F.ssh\u002Fid_rsa.pub"," if you generated the key in RSA format). If you chose to save the SSH key in another directory, simply place the path to that directory after the ",[30,166,150],{}," command.",[15,169,170],{},"To display in the terminal the public SSH key saved in the default directory, use:",[35,172,174],{"className":37,"code":173,"language":39,"meta":40,"style":40},"cat ~\u002F.ssh\u002F.id_rsa.pub\n",[30,175,176],{"__ignoreMap":40},[44,177,178,180],{"class":46,"line":47},[44,179,150],{"class":50},[44,181,182],{"class":58}," ~\u002F.ssh\u002F.id_rsa.pub\n",[15,184,185,186,188,189,193],{},"The ",[30,187,150],{}," command prints the contents of a file in the terminal. In this case, it will display the ",[190,191,192],"strong",{},"public SSH key",", which you must copy.",[22,195,197],{"id":196},"adding-the-ssh-key-to-your-github-account","Adding the SSH Key to Your GitHub Account",[15,199,200],{},"Now that your SSH key is copied, the next step is to link it to your GitHub account:",[202,203,204,211,217,224,231,237],"ol",{},[79,205,206,207,210],{},"While logged into GitHub, in the upper right corner, click on your profile picture and select ",[190,208,209],{},"Settings",".",[79,212,213,214,210],{},"In the left menu, click ",[190,215,216],{},"SSH and GPG keys",[79,218,219,220,223],{},"Click the ",[190,221,222],{},"New SSH key"," button.",[79,225,226,227,230],{},"In the ",[190,228,229],{},"Title"," field, enter a description for the key, such as \"Personal Computer\" or \"Work Computer\".",[79,232,226,233,236],{},[190,234,235],{},"Key"," field, paste the contents of your public key that you copied earlier.",[79,238,239,240,243],{},"Click ",[190,241,242],{},"Add SSH key"," to save.",[15,245,246,247,250,251,254],{},"Once this is done, when you run a Git command such as ",[30,248,249],{},"git pull"," or ",[30,252,253],{},"git push",", GitHub will use the SSH key you generated and configured.",[15,256,257],{},"::img{src=\"images\u002Fblog\u002Fgit\u002Fadd-new-ssh-key-on-github.webp\" alt=\"GitHub page for adding SSH key\" width=\"658\" height=\"488\"}::",[22,259,261],{"id":260},"conclusion","Conclusion",[15,263,264,265,272,273,210],{},"This article guided you through generating the SSH key and configuring it in GitHub. If you want more complementary content on the subject, you can watch ",[266,267,271],"a",{"href":268,"rel":269},"https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=oNSIShMKP1s",[270],"nofollow","this video on the Código ao Ponto YouTube channel"," or access the ",[266,274,277],{"href":275,"rel":276},"https:\u002F\u002Fdocs.github.com\u002Fen\u002Fauthentication\u002Fconnecting-to-github-with-ssh\u002Fgenerating-a-new-ssh-key-and-adding-it-to-the-ssh-agent",[270],"official GitHub documentation",[279,280,281],"style",{},"html pre.shiki code .sAOxA, html code.shiki .sAOxA{--shiki-default:#50FA7B}html pre.shiki code .sIQBb, html code.shiki .sIQBb{--shiki-default:#BD93F9}html pre.shiki code .s-mGx, html code.shiki .s-mGx{--shiki-default:#F1FA8C}html pre.shiki code .seVfx, html code.shiki .seVfx{--shiki-default:#E9F284}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}",{"title":40,"searchDepth":283,"depth":283,"links":284},2,[285,286,287,288],{"id":24,"depth":283,"text":25},{"id":132,"depth":283,"text":133},{"id":196,"depth":283,"text":197},{"id":260,"depth":283,"text":261},[290],"git","Learn how to generate, configure, and add an SSH key to GitHub for secure authentication, eliminating the need to enter your password for each access.","how-to-create-and-set-up-ssh-key-github","md",{},true,"\u002Fen\u002Fblog\u002Fhow-to-create-and-set-up-ssh-key-github","como-configurar-chave-ssh-no-git-para-usar-no-github","2025-02-04",{"title":5,"description":291},{"loc":296,"lastmod":298},"en\u002Fblog\u002Fhow-to-create-and-set-up-ssh-key-github",560,"mjyCucLlkFvpK7SCC_R6DVp3-1RBJlwkOR2PKdAVkpI",[305,314,322,331,338,340,347,355,362,370,376,384,391,398,405],{"id":306,"path":307,"title":308,"articleCover":309,"categoriesIds":310,"publishedAt":313},"blogEn\u002Fen\u002Fblog\u002Fcore-web-vitals-how-user-experience-affects-seo.md","\u002Fen\u002Fblog\u002Fcore-web-vitals-how-user-experience-affects-seo","Core Web Vitals and SEO: How User Experience Affects Your Site","\u002Fimages\u002Fen\u002Fblog\u002Fseo\u002Fweb-vitals\u002Fcore-web-vitals-how-user-experience-affects-seo.webp",[311,312],"seo","web-vitals","2024-10-25",{"id":315,"path":316,"title":317,"articleCover":318,"categoriesIds":319,"publishedAt":321},"blogEn\u002Fen\u002Fblog\u002Ffree-developer-tools-hub.md","\u002Fen\u002Fblog\u002Ffree-developer-tools-hub","I Built a Free Web Tools Hub for Developers","\u002Fimages\u002Fen\u002Fblog\u002Ftools\u002Ffree-developer-tools-hub.webp",[320],"tools","2026-01-06",{"id":323,"path":324,"title":325,"articleCover":326,"categoriesIds":327,"publishedAt":330},"blogEn\u002Fen\u002Fblog\u002Fhow-the-routing-system-works-in-nuxt.md","\u002Fen\u002Fblog\u002Fhow-the-routing-system-works-in-nuxt","Nuxt Routing: Dynamic, Nested and Catch-All Routes","\u002Fimages\u002Fblog\u002Fnuxt\u002Fnuxt-routing-thumb.webp",[328,329],"nuxt","vuejs","2025-03-12",{"id":332,"path":333,"title":334,"articleCover":335,"categoriesIds":336,"publishedAt":337},"blogEn\u002Fen\u002Fblog\u002Fhow-to-add-special-characters-on-i18n.md","\u002Fen\u002Fblog\u002Fhow-to-add-special-characters-on-i18n","How to Add Special Characters in i18N Translations","\u002Fimages\u002Fblog\u002Fi18n\u002Fi18n-special-characters-on-nuxtjs-thumb.webp",[328,329],"2025-02-02",{"id":4,"path":296,"title":5,"articleCover":6,"categoriesIds":339,"publishedAt":298},[290],{"id":341,"path":342,"title":343,"articleCover":344,"categoriesIds":345,"publishedAt":346},"blogEn\u002Fen\u002Fblog\u002Fhow-to-create-structured-data-with-nuxtjs.md","\u002Fen\u002Fblog\u002Fhow-to-create-structured-data-with-nuxtjs","What is Structured Data and How to Add it in Nuxt.JS","\u002Fimages\u002Fen\u002Fblog\u002Fseo\u002Fstructured-data\u002Fstructured-data-thumb-1.webp",[328,329,311],"2025-01-22",{"id":348,"path":349,"title":350,"articleCover":351,"categoriesIds":352,"publishedAt":354},"blogEn\u002Fen\u002Fblog\u002Fhow-to-deal-with-envy-from-other-programmers.md","\u002Fen\u002Fblog\u002Fhow-to-deal-with-envy-from-other-programmers","How to Deal with Envy from Other Programmers in Your Career","\u002Fimages\u002Fen\u002Fblog\u002Fcareer\u002Fa-nail-that-stands-out-gets-hammered.webp",[353],"career","2025-08-29",{"id":356,"path":357,"title":358,"articleCover":359,"categoriesIds":360,"publishedAt":361},"blogEn\u002Fen\u002Fblog\u002Fhow-to-use-middlewares-nuxtjs.md","\u002Fen\u002Fblog\u002Fhow-to-use-middlewares-nuxtjs","Middlewares: What They Are and How to Use Them in Nuxt.JS","\u002Fimages\u002Fblog\u002Fnuxt\u002Ffront-end-middlewares-thumb.webp",[328,329],"2025-02-03",{"id":363,"path":364,"title":365,"articleCover":366,"categoriesIds":367,"publishedAt":369},"blogEn\u002Fen\u002Fblog\u002Fhow-to-validate-cpf-with-javascript.md","\u002Fen\u002Fblog\u002Fhow-to-validate-cpf-with-javascript","How to validate a CPF with JavaScript","\u002Fimages\u002Fen\u002Fblog\u002Fjavascript\u002Fhow-to-validate-cpf-with-javascript.webp",[368,320],"javascript","2026-10-04",{"id":371,"path":372,"title":373,"articleCover":374,"categoriesIds":375,"publishedAt":369},"blogEn\u002Fen\u002Fblog\u002Fhow-to-validate-credit-card-with-javascript.md","\u002Fen\u002Fblog\u002Fhow-to-validate-credit-card-with-javascript","How to validate a credit card with JavaScript (Luhn algorithm)","\u002Fimages\u002Fen\u002Fblog\u002Fjavascript\u002Fhow-to-validate-credit-card-with-javascript.webp",[368,320],{"id":377,"path":378,"title":379,"articleCover":380,"categoriesIds":381,"publishedAt":383},"blogEn\u002Fen\u002Fblog\u002Frecovering-lost-files-in-git-with-vscode.md","\u002Fen\u002Fblog\u002Frecovering-lost-files-in-git-with-vscode","Recover Lost Files in Git Without a Commit Using VS Code Local History","\u002Fimages\u002Fen\u002Fblog\u002Fvscode\u002Fhow-to-recover-lost-files-in-git-using-vscode.webp",[290,382],"vscode","2025-01-21",{"id":385,"path":386,"title":387,"articleCover":388,"categoriesIds":389,"publishedAt":390},"blogEn\u002Fen\u002Fblog\u002Fvercel-buys-nuxt-labs.md","\u002Fen\u002Fblog\u002Fvercel-buys-nuxt-labs","Vercel Acquired Nuxt Labs! What Does This Mean for Nuxt?","\u002Fimages\u002Fen\u002Fblog\u002Fnuxt\u002Fvercel-buys-nuxt-labs.webp",[328],"2025-07-17",{"id":392,"path":393,"title":394,"articleCover":395,"categoriesIds":396,"publishedAt":397},"blogEn\u002Fen\u002Fblog\u002Fvue-vapor-mode-what-it-is-and-how-to-use-it.md","\u002Fen\u002Fblog\u002Fvue-vapor-mode-what-it-is-and-how-to-use-it","Vue Vapor Mode: what it is and what changes in Vue 3.6","\u002Fimages\u002Fen\u002Fblog\u002Fvue\u002Fvue-vapor-mode-what-it-is-and-how-to-use-it.webp",[329,328],"2026-10-06",{"id":399,"path":400,"title":401,"articleCover":402,"categoriesIds":403,"publishedAt":404},"blogEn\u002Fen\u002Fblog\u002Fwhat-are-directives-in-vue-and-how-to-implement-them.md","\u002Fen\u002Fblog\u002Fwhat-are-directives-in-vue-and-how-to-implement-them","Vue 3 Directives: Built-in and Custom","\u002Fimages\u002Fen\u002Fblog\u002Fvue\u002Fwhat-are-directives-in-vue-and-how-to-implement-them.webp",[329],"2025-03-21",{"id":406,"path":407,"title":408,"articleCover":409,"categoriesIds":410,"publishedAt":411},"blogEn\u002Fen\u002Fblog\u002Fwhat-is-the-difference-between-composition-api-and-options-api-in-vuejs.md","\u002Fen\u002Fblog\u002Fwhat-is-the-difference-between-composition-api-and-options-api-in-vuejs","Composition API vs Options API in Vue.js: What's the Difference?","\u002Fimages\u002Fen\u002Fblog\u002Fvue\u002Fwhat-is-the-difference-between-composition-api-and-options-api-in-vuejs.webp",[329],"2025-02-20",1791682334974]