{"id":17675570,"url":"https://github.com/ernanej/multiplas-sshkeys","last_synced_at":"2025-03-30T17:14:47.695Z","repository":{"id":112247953,"uuid":"371710465","full_name":"ErnaneJ/Multiplas-SSHKeys","owner":"ErnaneJ","description":"Quick guide to generating and managing multiple SSH Keys for github and Gitlab.","archived":false,"fork":false,"pushed_at":"2021-07-12T14:59:12.000Z","size":1,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T18:59:29.448Z","etag":null,"topics":["github-config","gitlab","ssh-git","ssh-key"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ErnaneJ.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2021-05-28T13:30:57.000Z","updated_at":"2024-01-17T13:21:51.000Z","dependencies_parsed_at":"2023-03-17T10:46:08.166Z","dependency_job_id":null,"html_url":"https://github.com/ErnaneJ/Multiplas-SSHKeys","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErnaneJ%2FMultiplas-SSHKeys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErnaneJ%2FMultiplas-SSHKeys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErnaneJ%2FMultiplas-SSHKeys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ErnaneJ%2FMultiplas-SSHKeys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ErnaneJ","download_url":"https://codeload.github.com/ErnaneJ/Multiplas-SSHKeys/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246351017,"owners_count":20763232,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-config","gitlab","ssh-git","ssh-key"],"created_at":"2024-10-24T07:22:46.693Z","updated_at":"2025-03-30T17:14:47.677Z","avatar_url":"https://github.com/ErnaneJ.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Múltiplas chaves SSH para GitHub e GitLab\n\n## 1. Gerar Chaves SSH\n\n``` bash\nssh-keygen -t rsa -C \"user@email.com\" -b 4096 -f ~/.ssh/id_rsa_github\nssh-keygen -t rsa -C \"user@email.com\" -b 4096 -f ~/.ssh/id_rsa_gitlab\n```\n\n## 2. Copiar chaves para GitHub e GitLab\n\n``` bash\n# Copiar chave pública para o GitHub\ncat \u003c ~/.ssh/id_rsa_github.pub\n# Em seguida colar no painel do GitHub\n\n# Copiar chave pública para o GitLab\ncat \u003c ~/.ssh/id_rsa_gitlab.pub\n# Em seguida colar no painel do GitLab\n```\n\n## 3. Adicionar as chaves ao SSH-Agent\n\n``` bash\nssh-add ~/.ssh/id_rsa_github\nssh-add ~/.ssh/id_rsa_gitlab\n```\n\n## 4. Arquivo de configuração\n\n``` bash\ntouch ~/.ssh/config\nnano ~/.ssh/config\n```\n\n**Arquivo** `config`\n\n```\n# Conta do GitHub\nHost github.com\n  HostName github.com\n  PreferredAuthentications publickey\n  IdentityFile ~/.ssh/id_rsa_github\n\n# Conta do GitLab\nHost gitlab.com\n  HostName gitlab.com\n  PreferredAuthentications publickey\n  IdentityFile ~/.ssh/id_rsa_gitlab\n```\n\n## 5. Testando as conexões\n\n``` bash\nssh -T git@github.com\nyes\n# Hi UserName! You've successfully authenticated, but GitHub does not provide shell access.\n\nssh -T git@gitlab.com\nyes\n# Welcome to GitLab, @UserName!\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernanej%2Fmultiplas-sshkeys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fernanej%2Fmultiplas-sshkeys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fernanej%2Fmultiplas-sshkeys/lists"}