我在Jenkins ver. 2.205
中有Windows 10
,并且有以下情况
Configure Global Security
选中了Enable security
。id_rsa_jenkins
和id_rsa_jenkins.pub
键。在SSH Public Keys
中,我的帐户的公钥值已添加到Jenkins。jenkins-cli.jar
文件,从http://localhost:9090/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
命令都会发生,例如:
等
缺少或存在什么错误?
对于观众:
原始帖子中提供的说明是强制性的。但是以下指示也是强制性的:
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.
此视频非常有价值: