Created
August 28, 2026 20:12
-
-
Save taq/09d2d09155bb3d52c2981b83e1046077 to your computer and use it in GitHub Desktop.
Comandos do vídeo https://www.youtube.com/watch?v=NUjUBUd3nBA
This file contains hidden or 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
| # verificando o hostname | |
| echo $HOSTNAME | |
| # gerando a chave SSH | |
| ssh-keygen -t ed25519 -C "seu-email@exemplo.com" -f ~/.ssh/id_$HOSTNAME | |
| # keychain do macOS | |
| eval "$(ssh-agent -s)" | |
| ssh-add --apple-use-keychain ~/.ssh/id_$HOSTNAME | |
| # Arquivo do .ssh/config.d | |
| Host github.com | |
| AddKeysToAgent yes | |
| UseKeychain yes | |
| IdentityFile ~/.ssh/id_<HOSTNAME> | |
| IdentitiesOnly yes | |
| # copiando a chave pública no macOS | |
| cat ~/.ssh/id_$HOSTNAME.pub | pbcopy | |
| # copiando a chave pública no Linux ou FreeBSD | |
| cat ~/.ssh/id_$HOSTNAME.pub | xclip -selection clipboard | |
| # copiando a chave pública no Wayland | |
| cat ~/.ssh/id_$HOSTNAME.pub | wl-copy | |
| # testando a chave | |
| ssh -T git@github.com | |
| # keychain no Ubuntu | |
| sudo apt install keychain | |
| # keychain no Fedora | |
| sudo dnf install keychain | |
| # keychain no Arch | |
| sudo pacman -S keychain | |
| # keychain no FreeBSD | |
| doas pkg install keychain | |
| # adicionando no `~/.bashrc`, `~/.zshrc` ou `~/.profile`: | |
| eval "$(keychain --eval --quiet ~/.ssh/id_$HOSTNAME)" | |
| # gera a chave GPG | |
| gpg --full-generate-key | |
| # lista as chaves secretas | |
| gpg --list-secret-keys --keyid-format LONG | |
| # copia a chave - ver outros sistemas acima | |
| gpg --armor --export SEU_KEY_ID | pbcopy | |
| # instalando o pinentry no macOS | |
| brew install pinentry-mac | |
| # configurando o `~/.gnupg/gpg-agent.conf` no macOS | |
| pinentry-program /opt/homebrew/bin/pinentry-mac | |
| # configurando o `~/.gnupg/gpg-agent.conf` no Linux ou FreeBSD | |
| pinentry-program /usr/local/bin/pinentry-qt | |
| # matando o agente, para recarregar | |
| gpgconf --kill gpg-agent |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment