Created
August 15, 2024 15:25
-
-
Save SerggioC/21b1c8afe3f7a8bcc2abf6344c40f429 to your computer and use it in GitHub Desktop.
Criar nova chave SSH
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Criar nova chave SSH | |
1- Gerar chave: | |
ssh-keygen -t ed25519 -C "[email protected]" | |
2- Adicionar chave ao agente: | |
#macOS | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_ed25519 | |
# Windows (Git Bash) | |
# Opção 1: | |
start-ssh-agent | |
# Opção 2: | |
SSH_AGENT_PID=$(gpg-agent --daemon) | |
export SSH_AGENT_PID | |
ssh-add ~/.ssh/id_ed25519 | |
3- Copiar a chave pública SSH para o clipboard: | |
pbcopy < ~/.ssh/id_ed25519.pub # macOS | |
cat ~/.ssh/id_ed25519.pub | xclip -selection clipboard # Linux | |
clip < ~/.ssh/id_ed25519.pub # Windows (Git Bash) | |
4- Adicionar chave pública à plataforma. | |
5- Verificar se a chave está a funcionar com o github: | |
ssh -T [email protected] | |
ou -v para modo verboso | |
ssh -vT [email protected] | |
6- If you're using multiple SSH keys or want to manage configurations, | |
you can create or update your ~/.ssh/config file: | |
nano ~/.ssh/config | |
Add the following lines: | |
Host github.com | |
HostName github.com | |
User git | |
IdentityFile ~/.ssh/id_ed25519 | |
Fingerpint da chave pública em sha256 | |
ssh-keygen -lf ~/.ssh/id_ed25519.pub -E sha256 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment