我买了一台新的Windows计算机,并在上面安装了putty。我从旧计算机导出注册表项并导入它们以恢复putty连接,避免手动添加它们。
我还将rsa公钥.ppk复制到新计算机上,并在putty中的Auth部分选择了它,但我得到了以下错误:
无法使用密钥文件"c:\path\to\id_rsa.ppk"(无法打开文件(
我被要求在VPS服务器中重新生成密钥对,但我认为公钥可以被任何计算机使用!
我是不是错过了什么?感谢您的帮助。
谢谢!
编辑:
Plink输出(Plink-vusername@hostname-i"c:\path\to\id_rsa.ppk"(按照@Martin Prikryl:的请求
We claim version: SSH-2.0-PuTTY_Release_0.70
Server version: SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.1
Using SSH protocol version 2
Doing ECDH key exchange with curve Curve25519 and hash SHA-256
Server also has ssh-ed25519/ecdsa-sha2-nistp256 host keys, but we don't know any of them
Host key fingerprint is:
ssh-rsa 2048 24:2a:c3:65:b9:9a:3e:5f:59:fc:dc:15:42:31:0b:a0
Initialised AES-256 SDCTR client->server encryption
Initialised HMAC-SHA-256 client->server MAC algorithm
Initialised AES-256 SDCTR server->client encryption
Initialised HMAC-SHA-256 server->client MAC algorithm
Reading key file "D:pathtoid_rsa.ppk"
Using username "user".
Offered public key
Offer of public key accepted
Authenticating with public key "imported-openssh-key"
Sent public key signature
Access granted
Opening session as main channel
Opened main channel
Allocated pty (ospeed 38400bps, ispeed 38400bps)
Started a shell/command
编辑2:
putty.exe-vusername@hostname-i"c:\path\to\id_rsa.ppk"引发超时错误。
您似乎没有在Connection>SSH>Auth页面上"选择"密钥。
您只在那里键入了密钥名称,没有路径。所以PuTTY找不到它。
您需要使用密钥文件的完整路径,如C:pathtoid_rsa.ppk
。
点击此链接:
You used Putty Private Key format (.ppk)
Convert your ppk to Openssh Key File (id_rsa)
这里有一个如何做的解释。希望它能有所帮助。