Skip to content

Instantly share code, notes, and snippets.

@mstuttgart
Last active June 5, 2023 14:06
Show Gist options
  • Save mstuttgart/df2a9232b45e198aeb2d699402752e95 to your computer and use it in GitHub Desktop.
Save mstuttgart/df2a9232b45e198aeb2d699402752e95 to your computer and use it in GitHub Desktop.
[Restaurar chaves SSH] Restaurando chaves SSH após backup #linux #ssh

Copie ambos os arquivos id_rsa e id_rsa.pub para o diretório ~/.ssh/.

Em seguida, altere as permissões e o proprietário dos arquivos

$ chown user:user ~/.ssh/id_rsa*
$ chmod 600 ~/.ssh/id_rsa
$ chmod 644 ~/.ssh/id_rsa.pub

Executamos o agent SSH, para que ele carregue as novas chaves.

$ exec ssh-agent bash

Adicionamos a chave privada ao agent.

$ ssh-add ~/.ssh/id_rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment