Jenkins通过SSH身份验证发布失败,并带有私钥

编程入门 行业动态 更新时间:2024-10-25 10:22:55
本文介绍了Jenkins通过SSH身份验证发布失败,并带有私钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我可以使用我的private key和密码在服务器上的putty上成功进行身份验证.但是,当我尝试使用jenkins 通过SSH发布插件(使用测试进行配置")来执行此操作时,出现以下错误消息:

I can authenticate successfully with putty on the server with my private key and passphrase. But when I try to do it with jenkins publish over SSH plugin (using Test for configuration), I get the following error message:

jenkins.plugins.publish_over.BapPublisherException: Failed to connect session for config myconfig. Message [Auth fail]

我输入了与腻子相同的信息:

I entered the same information as in putty:

主机名:myhostname 用户名:myusername 远程目录: 使用密码身份验证,或使用其他密钥密码/密码 密钥路径:已选中 密钥路径:mypath 密码短语:mypasssword 键: 端口:22 超时(毫秒):300000

Hostname : myhostname Username : myusername Remote Directory : Use password authentication, or use a different key Passphrase / Password Path to key : checked Path to key : mypath Passphrase : mypasssword Key: Port:22 Timeout(ms):300000

如果您有任何想法... 感谢您的帮助.

If you have any idea ... Thanks for your help.

推荐答案

您似乎正在使用密钥文件身份验证,因此,如果您未正确设置.ssh文件夹的权限,则会从Jenkins收到此错误和/或~/.ssh/authorized_keys文件.

Looks like you're using keyfile authentication, so you'll get this error from Jenkins if you haven't set the permissions correctly on your .ssh folder and/or ~/.ssh/authorized_keys file.

  • .ssh文件夹应具有drwx------权限(仅读取/写入/执行所有者)
  • authorized_keys文件应具有-rw-------权限(仅读/写所有者)
  • the .ssh folder should have drwx------ permissions (read/write/execute owner only)
  • the authorized_keys file should have -rw------- permissions (read/write owner only)

要修复它:

chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys

更多推荐

Jenkins通过SSH身份验证发布失败,并带有私钥

本文发布于:2023-10-29 09:46:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1539372.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:身份验证   Jenkins   SSH

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!