vault backup: 2025-12-08 17:06:53

This commit is contained in:
杜鹏飞
2025-12-08 17:06:53 +08:00
parent 07202e660e
commit b51fba05fd
3 changed files with 57 additions and 17 deletions

View File

@@ -0,0 +1,30 @@
### 生成新密钥
```
gpg --full-generate-key
```
- 选择密钥类型:默认 `RSA and RSA`(按回车)
- 密钥长度:建议 `4096`
- 有效期:可以设为 `0`(永不过期)或指定年限
- 输入你的 **真实姓名** 和 **邮箱地址**(必须与 Git 配置中的 user.email 一致!)
### 查看已有的 GPG 密钥
```
gpg --list-secret-keys --keyid-format=long
```
###  Git 使用这个 GPG 密钥
```
git config --global user.signingkey xxx
```
### 配置 Git 默认签名提交
```
git config --global commit.gpgsign true
```
### 导出公钥并添加到 GitHub/GitLab 等平台
```
gpg --armor --export xxxxx
```