Skip to content

Commit addaa49

Browse files
committed
docs(vscode): 添加 Linux 终端下生成 SSH 密钥对的详细步骤
新增第 1.1 步内容,详细介绍如何在 Linux 终端环境下生成 Ed25519 算法的 SSH 密钥对, 包括密钥生成命令、密钥文件位置说明以及公钥内容的查看方法。
1 parent 2c3e373 commit addaa49

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

docs/cheatsheet/vscode/ssh_nopasswd.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,36 @@
2929

3030
---
3131

32+
### 第 1.1 步:在 Linux (终端)
33+
34+
**1. 生成 SSH 密钥对**
35+
36+
* 推荐使用 Ed25519 算法。
37+
38+
```bash
39+
ssh-keygen -t ed25519 -C "your_email@example.com"
40+
```
41+
* 一路按回车键即可 (默认路径,无密码短语)。
42+
43+
**2. 定位密钥文件**
44+
45+
* **私钥 (Private Key):** `~/.ssh/id_ed25519`
46+
> **[警告]** 此文件绝对不能泄露!
47+
* **公钥 (Public Key):** ``
48+
> **[提示]** 这是需要复制到目标服务器的文件。
49+
50+
**3. 复制公钥内容**
51+
52+
* 在终端中执行以下命令,然后复制整行输出。
53+
54+
```bash
55+
cat ~/.ssh/id_ed25519.pub
56+
```
57+
58+
* 公钥内容以 `ssh-ed25519``ssh-rsa` 开头。
59+
60+
---
61+
3262
### 第 2 步:在 macOS (终端)
3363

3464
**1. 粘贴公钥**

0 commit comments

Comments
 (0)