Skip to content

Instantly share code, notes, and snippets.

@Venicyus
Created March 4, 2025 19:46
Show Gist options
  • Save Venicyus/eed6cd80acba215ed37052ecaefa09e6 to your computer and use it in GitHub Desktop.
Save Venicyus/eed6cd80acba215ed37052ecaefa09e6 to your computer and use it in GitHub Desktop.
Configuração do SSH

Configuração do SSH para github

1 - Criar chaves no seu host, altere o trecho [email protected] pelo seu email

ssh-keygen -t rsa -C "[email protected]" -b 4096 -f ~/.ssh/id_rsa_github

2 - Adicionar as chaves ao SSH-Agent

ssh-add ~/.ssh/id_rsa_github

Obs.: Caso apareça a mensagem Could not open a connection to your authentication agent execute o comando eval $(ssh-agent -s) e tente o comando acima novamente.

3 - Criar arquivo de configuração

A - Crie o arquivo config dentro de .shh

touch ~/.ssh/config

B - Cole o seguinte trecho de código dentro do arquivo ~/.ssh/config

nano ~/.ssh/config

Copiar e colar:

Host github.com
  HostName github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa_github

Salvar o arquivo:

Ctrl X
Y or S
Enter

4 - Execute o comando para mostrar a chave e copie para colocar no GitHub

cat ~/.ssh/id_rsa_github.pub

5 -Testando a comunicação entre seu host e o GitHub

6 - Configuração do Git

A - Instale o GIT na sua distro ou WLS2

sudo apt install git

B - Adicione as seguintes configurações (Coloque suas informações)

git config --global user.name "user name"
git config --global user.email "[email protected]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment