我想知道,plink 从哪里获取其默认的私钥文件?
如果我没有指定任何密钥文件,它总是选择以下私钥文件。
C:\putty\digitalocean.ppk
尽管我已确保 Pageant 仅加载 1 个 Github 私钥文件(位于 C:\putty\github2.ppk)
不知何故,Plink 总是能接通C:\putty\digitalocean.ppk
我有
- 重新安装Putty
- 删除所有内容
C:\Users\yccheok\.ssh
尽管如此,我还是
C:\Users\yccheok>plink.exe -v [email protected]
Looking up host "github.com" for SSH connection
Connecting to 20.205.243.166 port 22
We claim version: SSH-2.0-PuTTY_Release_0.76
Connected to 20.205.243.166
Remote version: SSH-2.0-babeld-e1420b26
Using SSH protocol version 2
No GSSAPI security context available
Doing ECDH key exchange with curve Curve25519 and hash SHA-256 (unaccelerated)
Server also has ecdsa-sha2-nistp256/rsa-sha2-512/rsa-sha2-256/ssh-rsa host keys, but we don't know any of them
Host key fingerprint is:
ssh-ed25519 255 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU
Initialised AES-256 SDCTR (AES-NI accelerated) outbound encryption
Initialised HMAC-SHA-256 (unaccelerated) outbound MAC algorithm
Initialised AES-256 SDCTR (AES-NI accelerated) inbound encryption
Initialised HMAC-SHA-256 (unaccelerated) inbound MAC algorithm
Reading key file "C:\putty\digitalocean.ppk"
Pageant is running. Requesting keys.
Pageant has 2 SSH-2 keys
Pageant key #0 matches configured key file
Using username "git".
Trying Pageant key #0
Server refused our key
Offered public key
Server refusServer refused our key
ed our key
No supported authentication methods available (server sent: publickey)
FATAL ERROR: No supported authentication methods available (server sent: publickey)
请问这是为什么呢?如何确保 plink 获取到 Pageant 中加载的私钥文件?
答案1
IIRC plink 使用 PuTTy 设置。这些设置保存在注册表中,卸载 PuTTy 时不会被删除。
注册表中的位置:
Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\Default%20Settings
您可以手动编辑注册表设置,或者打开 PuTTy,从默认设置中删除该项,然后以名称再次存储它Default Settings
。
位置:连接 -> SSH -> 身份验证
这也应该可以被 plink 接收。