Skip to content

Commit

Permalink
Added GPG and SSH key restore
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag3301 committed Jul 5, 2021
1 parent d91841b commit 4f66a00
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions git.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,19 @@ gpg --export-secret-keys $ID > my-private-key.asc
```sh
# Just zip the ~/.ssh dir
cd ~ && zip -r ssh-key.zip .ssh
```

## Restore GPG and SSH Key
#### For GPG key
```sh
gpg --import my-private-key.asc
```
### For SSH key
```sh
cp ssh-key.zip ~ && cd ~ && unzip ssh-key.zip
chown anurag:anurag ~/.ssh/id_rsa*
chmod 600 ~/.ssh/id_rsa
chmod 644 ~/.ssh/id_rsa.pub
eval $(ssh-agent -s)
ssh-add ~/.ssh/id_rsa
```

0 comments on commit 4f66a00

Please sign in to comment.