DBeaver ssh 隧道无效的私钥 [英] DBeaver ssh tunnel invalid private key

查看:398
本文介绍了DBeaver ssh 隧道无效的私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只想把它留在这里,这样解决方案的链接就不会丢失.

我有一个 4096 字节的 RSA 私有密钥(可能它是使用本指南生成的 https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-ssh-agent).

我在尝试使用 DBeaver (6.1.2) 通过 ssh 隧道建立新连接时出错.

<预><代码>无效的私钥:[B@540.....

解决方案

此错误是由 SSH 私钥的格式引起的.默认情况下,ssh-keygen 使用 OpenSSH 格式创建一个私钥——带有这个头:

-----BEGIN OPENSSH PRIVATE KEY-----

但 DBeaver 只接受使用旧 PEM 格式的密钥 - 带有此标头:

-----开始RSA私钥--

您可以使用以下方法直接使用正确的标头生成密钥:

ssh-keygen -t rsa -b 2048 -m PEM

或者您可以转换现有的密钥(小心!这会覆盖现有的密钥,您只需复制私钥并在副本上应用命令):

ssh-keygen -p -m PEM -f id_rsa

DBeaver 的 GitHub 上有一个未解决的问题.

Just want to leave it here, so the link to the solution won't be lost.

I have a private 4096-byte RSA key (probably it was generated using this guide https://help.github.com/en/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent).

I've got an error while trying to establish a new connection through an ssh tunnel using DBeaver (6.1.2).


invalid privatekey: [B@540.....

解决方案

This error is due to the format of the SSH private key. By default, ssh-keygen is creating a private key using the OpenSSH format—with this header:

-----BEGIN OPENSSH PRIVATE KEY-----

But DBeaver only accept keys using the older PEM format—with this header:

-----BEGIN RSA PRIVATE KEY-----

You can either generate a key directly with the correct header using:

ssh-keygen -t rsa -b 2048 -m PEM

Or you can convert an existing key (careful! this overwrite the existing key, you can just copy the private key and apply the command on the copy):

ssh-keygen -p -m PEM -f id_rsa

There is an open issue on DBeaver's GitHub.

这篇关于DBeaver ssh 隧道无效的私钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆