This commit is contained in:
陈浩南 2024-05-01 12:36:49 +08:00
parent e7bbe85438
commit 1267ba6c90
3 changed files with 24 additions and 5 deletions

BIN
doc/pageant2.png (Stored with Git LFS) Normal file

Binary file not shown.

BIN
doc/putty1.png (Stored with Git LFS)

Binary file not shown.

View File

@ -15,16 +15,31 @@
![](pageant1.png)
3. 双击 Pageant 图标,打开 Pageant 窗口。选择 “Add Key”然后选择您的密钥文件。
![](pageant2.png)
4. 在使用服务器期间保持 Pageant 打开(可以关闭 Pageant 的窗口,但不要在系统托盘中右键退出)。
5. 使用完毕后,在系统托盘中右键退出 Pageant。
> [!TIP]
> 如果您觉得每次打开 Pageant 都要手动添加密钥很麻烦,并且熟悉 Windows 命令行的使用,
> 可以编写一个批处理文件(将下方代码用记事本保存,然后将扩展名从 `.txt` 改为 `.bat`),每次双击该文件即可启动 Pageant 并自动添加密钥:
>
> `"C:\ProgramData\chocolatey\bin\PAGEANT.EXE" "Z:\.ssh\id_rsa.ppk"`
>
> 其中第一个引号内为 Pageant 的路径,第二个引号内为您的密钥文件的路径。
>
> 也可以将该批处理文件放入开机启动项中,使得 Pageant 在开机时自动启动。
>
> 因为每个人的密钥文件以及 Pageant 的路径都可能不同,所以这里无法提供通用的批处理文件。
**PuTTY**:
1. 在 Connection -> SSH -> Auth勾选 “Allow agent forwarding“ 并保存。
1. 在 Connection -> SSH -> Auth勾选“Attempt authentication using Pageant”和“Allow agent forwarding”
![Alt text](putty1.png)
2. 在 Connection -> SSH -> Auth -> Credentials清空 “Private key file for authentication”。
2. 在 Connection -> SSH -> Auth -> Credentials清空 “Private key file for authentication”,然后保存
![Alt text](putty2.png)
@ -33,6 +48,7 @@
1. 在 SSH -> Authentication勾选 “使用 Pageant 进行认证”,勾选 “允许代理转发”,清空 “密钥文件”,然后保存。
![Alt text](winscp1.png)
2. (选做)如果您需要通过 WinSCP 打开 PuTTY 的话,需要在 WinSCP 主界面 -> 工具 -> 选项 -> 集成 -> 应用程序路径中填入 PuTTY 的路径。
2. (选做)如果您需要通过 WinSCP 打开 PuTTY 的话,需要在 WinSCP 主界面 -> 工具 -> 选项 -> 集成 -> 应用程序路径中,
在原来的基础上增加 `-A` 参数。
![Alt text](winscp2.png)