Jenkins CLI 不工作:警告:Jenkins 返回 No header 'X-SSH-Endpoint'
Jenkis CLI does not work: WARNING: No header 'X-SSH-Endpoint' returned by Jenkins
我在Windows 10
中有Jenkins ver. 2.205
,我有以下情况
Configure Global Security
已检查 Enable security
。
- 我创建了
id_rsa_jenkins
和 id_rsa_jenkins.pub
键。 public 密钥的值已添加到我在 SSH Public Keys
. 中的帐户的 Jenkins
- 我有
jenkins-cli.jar
文件,下载自 http://localhost:9090/cli/
CLI
当我执行以下命令时(为了演示目的分成多行):
java -jar jenkins-cli.jar
-s http://localhost:9090/
-i C:\Users\windowsusername/.ssh/id_rsa_jenkins
-ssh
-user jenkinsusername
help
出现:
Enter passphrase for C:\Users\windowsusername\.ssh\id_rsa_jenkins:
问题
我输入了有效的密码然后出现了以下内容:
Nov 23, 2019 11:28:22 AM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider
Nov 23, 2019 11:28:22 AM hudson.cli.SSHCLI sshConnection
WARNING: No header 'X-SSH-Endpoint' returned by Jenkins
如上图,没有出现预期的数据
任何 Jenkins CLI
命令都会发生这种情况,例如:
- 帮助
- who-am-i
- list-jobs
等等
缺少什么或错了什么?
观众:
原 post 中提供的说明是强制性的。但以下说明也是强制性的:
- 已安装
SSH
插件
- 在
Configure Global Security
的 SSH Server
部分(底部),继续启用它,在本例中我使用 Fixed
值选项。
注意 似乎 random
选项仅对 jenkins-cli.jar
情况有用。这是因为通过 SSH
连接(即:ssh -l jenkinsusername -p 2020 localhost list-jobs
)是强制知道端口的,在本例中为 2020
。
因此 Fixed
或 Random
对于 jenkins-cli.jar
是可行的(它不要求使用端口号)但是对于 SSH
连接是强制知道端口号的(这里Fixed
是需要的)
此外在Jenkins SSH中表示:
Configuration
By default, Jenkins will listen on a random available port, so as not to break
existing deployments. But this is most likely not very useful, so the administrator
is encouraged to change this from the global security configuration page by assigning
a fixed port. This configuration UI will also allow you to disable this feature.
这个视频很有价值:
我在Windows 10
中有Jenkins ver. 2.205
,我有以下情况
Configure Global Security
已检查Enable security
。- 我创建了
id_rsa_jenkins
和id_rsa_jenkins.pub
键。 public 密钥的值已添加到我在SSH Public Keys
. 中的帐户的 Jenkins
- 我有
jenkins-cli.jar
文件,下载自http://localhost:9090/cli/
CLI
当我执行以下命令时(为了演示目的分成多行):
java -jar jenkins-cli.jar
-s http://localhost:9090/
-i C:\Users\windowsusername/.ssh/id_rsa_jenkins
-ssh
-user jenkinsusername
help
出现:
Enter passphrase for C:\Users\windowsusername\.ssh\id_rsa_jenkins:
问题
我输入了有效的密码然后出现了以下内容:
Nov 23, 2019 11:28:22 AM org.apache.sshd.common.util.security.AbstractSecurityProviderRegistrar getOrCreateProvider
INFO: getOrCreateProvider(EdDSA) created instance of net.i2p.crypto.eddsa.EdDSASecurityProvider
Nov 23, 2019 11:28:22 AM hudson.cli.SSHCLI sshConnection
WARNING: No header 'X-SSH-Endpoint' returned by Jenkins
如上图,没有出现预期的数据
任何 Jenkins CLI
命令都会发生这种情况,例如:
- 帮助
- who-am-i
- list-jobs
等等
缺少什么或错了什么?
观众:
原 post 中提供的说明是强制性的。但以下说明也是强制性的:
- 已安装
SSH
插件 - 在
Configure Global Security
的SSH Server
部分(底部),继续启用它,在本例中我使用Fixed
值选项。
注意 似乎 random
选项仅对 jenkins-cli.jar
情况有用。这是因为通过 SSH
连接(即:ssh -l jenkinsusername -p 2020 localhost list-jobs
)是强制知道端口的,在本例中为 2020
。
因此 Fixed
或 Random
对于 jenkins-cli.jar
是可行的(它不要求使用端口号)但是对于 SSH
连接是强制知道端口号的(这里Fixed
是需要的)
此外在Jenkins SSH中表示:
Configuration
By default, Jenkins will listen on a random available port, so as not to break
existing deployments. But this is most likely not very useful, so the administrator
is encouraged to change this from the global security configuration page by assigning
a fixed port. This configuration UI will also allow you to disable this feature.
这个视频很有价值: