Skip to content

Instantly share code, notes, and snippets.

@walternascimentobarroso
Created July 8, 2024 13:17
Show Gist options
  • Select an option

  • Save walternascimentobarroso/f3fc73e5eea2b9ce0fffbb13aaae2d3a to your computer and use it in GitHub Desktop.

Select an option

Save walternascimentobarroso/f3fc73e5eea2b9ce0fffbb13aaae2d3a to your computer and use it in GitHub Desktop.
#!/bin/bash
# Gera uma chave SSH com seu email
echo "Digite o seu email para gerar a chave SSH:"
read user_email
ssh-keygen -t ed25519 -C "$user_email" -f ~/.ssh/id_ed25519 -N ""
# Adiciona a chave SSH ao agente SSH
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_ed25519
# Exibe a chave pública
echo "Aqui está a sua chave pública SSH. Copie e adicione-a ao seu GitHub:"
cat ~/.ssh/id_ed25519.pub
# Abre a página de adição de nova chave SSH no GitHub (macOS only)
open "https://github.com/settings/ssh/new"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment