Skip to content

Instantly share code, notes, and snippets.

@SerggioC
Created August 15, 2024 15:25
Show Gist options
  • Save SerggioC/21b1c8afe3f7a8bcc2abf6344c40f429 to your computer and use it in GitHub Desktop.
Save SerggioC/21b1c8afe3f7a8bcc2abf6344c40f429 to your computer and use it in GitHub Desktop.
Criar nova chave SSH
Criar nova chave SSH
1- Gerar chave:
ssh-keygen -t ed25519 -C "your_email@example.com"
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 git@github.com
ou -v para modo verboso
ssh -vT git@github.com
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