我想知道,plink從哪裡取得它的預設私鑰檔案?
如果我沒有指定任何金鑰文件,它總是選擇以下私鑰文件。
C:\putty\digitalocean.ppk
即使我已確保 Pageant 僅加載 1 個 Github 私鑰檔案(位於 C:\putty\github2.ppk)
不知何故,Plink 仍然總是接聽C:\putty\digitalocean.ppk
我有
- 重新安裝膩子
- 刪除所有內容
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 接收。