Skip to content

Instantly share code, notes, and snippets.

@arthuralvim
Last active October 1, 2018 18:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arthuralvim/9769d45a143e617db0316bd31e2772a6 to your computer and use it in GitHub Desktop.
Save arthuralvim/9769d45a143e617db0316bd31e2772a6 to your computer and use it in GitHub Desktop.
Sobre chaves SSH

Ref:

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Gerar chaves com email como label

$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"

Dar um novo local para a chave

Enter a file in which to save the key (/Users/you/.ssh/id_rsa): /Users/you/.ssh/<project_name>.key [Press enter]

Deixando a chave mais segura

Enter passphrase (empty for no passphrase): <super-mega-password> [Type a passphrase]
Enter same passphrase again: <super-mega-password> [Type passphrase again]

Checar se agente está rodando

$ eval "$(ssh-agent -s)"

Para carregar as chaves automaticamente (somente para MacOS Sierra)

O arquivo ~/.ssh/config deve possuir o conteúdo abaixo:

Host *
 AddKeysToAgent yes
 UseKeychain yes
 IdentityFile ~/.ssh/id_rsa

Adicionar chave no agente SSH

ssh-add -K ~/.ssh/id_rsa

Dar permissões adequadas para a chave

chmod 600 .ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment