简体   繁体   English

PhpStorm中的神秘Gitlab SSH密钥

[英]Mysterious Gitlab SSH Key in PhpStorm

I am trying to push project files to a network repository on Gitlab using PhpStorm. 我正在尝试使用PhpStorm将项目文件推送到Gitlab上的网络存储库。

I have installed Git and generated an SSH key with a password, and added the key to Gitlab. 我已经安装了Git并生成了带有密码的SSH密钥,并将密钥添加到了Gitlab。

在此处输入图片说明

I have also copied my Gitlab profile's SSH URL to the clipboard. 我还将我的Gitlab配置文件的SSH URL复制到了剪贴板。

在此处输入图片说明

Now, when I go to PhpStorm's VCS->Git->Push , click on "Define remote", Paste the Gitlab SSH URL into the "URL" field, and click "OK", PhpStorm displays a message containing a very different key than the one I set up in Gitlab. 现在,当我转到PhpStorm的VCS->Git->Push ,单击“定义远程”,将Gitlab SSH URL粘贴到“ URL”字段中,然后单击“确定”,PhpStorm将显示​​一条消息,该消息包含与我在Gitlab中设置的那个。

Here are pics of the steps I take in PhpStorm: 这是我在PhpStorm中采取的步骤的照片:

Step 1: 第1步:

在此处输入图片说明

Step 2: 第2步:

在此处输入图片说明

Step 3: 第三步:

在此处输入图片说明

Look closely at this dialog box. 仔细查看此对话框。 It is listing a different key than the one I added to my Profile in Gitlab. 它列出的密钥与我在Gitlab中添加到“个人资料”的密钥不同。

If I click "Yes" or "No", it asks me for the key's password. 如果我单击“是”或“否”,它将要求我输入密钥的密码。 If type in the password that was defined for the other key, PhpStorm does not accept it. 如果键入为其他密钥定义的密码,则PhpStorm将不接受该密码。

Where could the key shown in Step 3 come from? 步骤3中显示的密钥从何而来?

The key shown in the popup box is the SSH Host Key of the server that hosts your GitLab instance and is used to verify that you are connecting to the server you expected to connect to. 弹出框中显示的密钥是托管您的GitLab实例的服务器的SSH主机密钥,用于验证您是否正在连接到要连接的服务器。

It has no relation to your SSH key you set in GitLab. 它与您在GitLab中设置的SSH密钥无关。

As for your final question, the password that PHPStorm is asking for could be the password of the git user. 至于您的最后一个问题,PHPStorm要求的密码可以是git用户的密码。 Checkout this question and this question for help resolving that issue. 请查看此问题以及此问题以帮助解决该问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM