rsa - 新 Windows 机器上的 Putty 和 rsa 公钥错误
问题描述
我买了一台新的 Windows 电脑并在上面安装了 putty。我从旧计算机导出注册表项并导入它们以恢复 Putty 连接并避免手动添加它们。
我还将 rsa 公钥 .ppk 复制到新计算机并在 putty 的 Auth 部分中选择它,但出现以下错误:
无法使用密钥文件“c:\path\to\id_rsa.ppk”(无法打开文件)
我很想在 VPS 服务器中重新生成密钥对,但我认为任何计算机都可以使用公钥!
我错过了什么吗?任何帮助表示赞赏。
谢谢!
编辑:
根据@Martin Prikryl 的要求,Plink 输出(plink -v username@hostname -i "c:\path\to\id_rsa.ppk"):
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:\path\to\id_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 -v username@hostname -i "c:\path\to\id_rsa.ppk" 抛出超时错误。
解决方案
您似乎没有在Connection > SSH > Auth页面上“选择”密钥。
您只在此处输入了键名,没有路径。所以 PuTTY 找不到它。
您需要使用密钥文件的完整路径,例如C:\path\to\id_rsa.ppk
.
推荐阅读
- python-3.x - 定义函数以对 df 中的记录进行分类并添加新列。熊猫 dfs
- python - python web抓取请求错误(mod安全)
- android - 几秒钟后如何在 Android 10 中重启 Android 应用
- android - 项目结构如何
- ios - 为什么编译器在一个项目上显示错误,而在同一个库 CDMarkdownKit 的另一个项目上却没有?
- c# - 使用程序的方法?
- docker - 尝试在 AWS 上安装 RocketChat,犯了一些错误
- python - 对数组中的每行应用 argsort,根据阈值跳过某些元素 - NumPy / Python
- python - ret = torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index) throws IndexError: Target 42 is out of bounds
- mysql - 如何在 TypeORM 中创建具有 TIME 类型的实体列