{"id":822,"date":"2022-06-30T11:23:05","date_gmt":"2022-06-30T03:23:05","guid":{"rendered":"http:\/\/www.rchen.top\/?p=822"},"modified":"2022-06-30T11:23:07","modified_gmt":"2022-06-30T03:23:07","slug":"jenkins%e4%b8%80%e4%ba%9b%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e5%a4%84%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.rchen.top\/?p=822","title":{"rendered":"jenkins\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u5904\u7406"},"content":{"rendered":"<p><b>\u95ee\u9898<\/b><b>1<\/b><b>\u3001<\/b><b>jenkins:<\/b><b>\u914d\u7f6e\u5bc6\u94a5\u65f6\u62a5\u9519\u7684\u89e3\u51b3\uff1a<\/b><b>Failed to add SSH key. Message invalid privatekey(Jenkins 2.257)<\/b><\/p>\n<p><b>\u95ee\u9898\u73b0\u8c61\uff1a<\/b><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"734\" height=\"340\" class=\"alignnone wp-image-823 size-full\" src=\"http:\/\/www.rchen.top\/wp-content\/uploads\/2022\/06\/Pasted-93.png\" \/><\/p>\n<p><b>\u539f\u56e0<\/b><b>\uff1a<\/b><\/p>\n<p>\u56e0\u4e3a\u6211\u4eec\u751f\u6210\u5bc6\u94a5\u7684openssh\u7684\u7248\u672c\u8fc7\u9ad8\u7684\u539f\u56e0<\/p>\n<p>\u770b\u4f8b\u5b50\uff1a\u5148\u751f\u6210\u5bc6\u94a5<\/p>\n<p>[root@localhost ~]# ssh-keygen -t rsa<\/p>\n<p>\u67e5\u770b\u6240\u751f\u6210\u79c1\u94a5\u7684\u683c\u5f0f:<\/p>\n<p>[root@localhost ~]$ more .ssh\/id_rsa<\/p>\n<p>&#8212;&#8211;BEGIN OPENSSH PRIVATE KEY&#8212;&#8211;<\/p>\n<p>b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn<\/p>\n<p>\u2026<\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u5bc6\u94a5\u7684\u9996\u884c\u662f:<\/p>\n<p>&#8212;&#8211;BEGIN OPENSSH PRIVATE KEY\u2014\u2014<\/p>\n<p>\u800cjenkins 2.2.57 \u7248\u672c\u5728\u68c0\u9a8c\u5bc6\u94a5\u65f6\u8fd8\u4e0d\u652f\u6301\u8fd9\u79cd\u683c\u5f0f\uff0c<\/p>\n<p><b>\u89e3\u51b3\u65b9\u6cd5<\/b><b>:<\/b><\/p>\n<p>1\uff0c\u6307\u5b9a\u683c\u5f0f<\/p>\n<p>[root@localhost ~]# ssh-keygen -m PEM -t rsa -b 4096<\/p>\n<p>\u8bf4\u660e\uff1a<\/p>\n<p>-m \u53c2\u6570\u6307\u5b9a\u5bc6\u94a5\u7684\u683c\u5f0f\uff0cPEM\u662frsa\u4e4b\u524d\u4f7f\u7528\u7684\u65e7\u683c\u5f0f<\/p>\n<p>-b \u6307\u5b9a\u5bc6\u94a5\u957f\u5ea6\u3002\u5bf9\u4e8eRSA\u5bc6\u94a5\uff0c\u6700\u5c0f\u8981\u6c42768\u4f4d\uff0c\u9ed8\u8ba4\u662f2048\u4f4d\u3002<\/p>\n<p><b>\u95ee\u9898<\/b><b>2<\/b><b>\u3001<\/b><b>j<\/b><b>enkins<\/b><b> wget<\/b><b>\u8bf7\u6c42\u4e0b\u8f7d\u94fe\u63a5\u62a5<\/b><b>403<\/b><b>\u9519\u8bef<\/b><\/p>\n<p><b>\u62a5\u9519\u73b0\u8c61\uff1a<\/b><\/p>\n<p>\u5f53\u5e94\u7528\u670d\u52a1\u5668\u4f7f\u7528wget\u8bf7\u6c42Jenkins\u94fe\u63a5\u4e0b\u8f7dwar\u5305\u65f6\uff0c\u8fd4\u56de403\u9519\u8bef<\/p>\n<p>[root@tomcat-2 webapps]# wget -c <a href=\"http:\/\/10.100.7.33:8080\/jenkins\/job\/web.gitee.html.master.maven\/lastSuccessfulBuild\/artifact\/target\/tfopsUI.war\">http:\/\/10.100.7.33:8080\/jenkins\/job\/web.gitee.html.master.maven\/lastSuccessfulBuild\/artifact\/target\/tfopsUI.war<\/a><\/p>\n<p>&#8211;2021-01-28 15:07:51&#8211;\u00a0 <a href=\"http:\/\/10.100.7.33:8080\/jenkins\/job\/web.gitee.html.master.maven\/lastSuccessfulBuild\/artifact\/target\/tfopsUI.war\">http:\/\/10.100.7.33:8080\/jenkins\/job\/web.gitee.html.master.maven\/lastSuccessfulBuild\/artifact\/target\/tfopsUI.war<\/a><\/p>\n<p>\u6b63\u5728\u8fde\u63a5 10.100.7.33:8080&#8230; \u5df2\u8fde\u63a5\u3002<\/p>\n<p>\u5df2\u53d1\u51fa HTTP \u8bf7\u6c42\uff0c\u6b63\u5728\u7b49\u5f85\u56de\u5e94&#8230; 403<\/p>\n<p>2021-01-28 15:07:51 \u9519\u8bef 403\uff1a(\u6ca1\u6709\u63cf\u8ff0)\u3002<\/p>\n<p><b>\u89e3\u51b3\u65b9\u6848\uff1a<\/b><\/p>\n<p>\u539f\u56e0\uff1a\u670d\u52a1\u5668\u83b7\u53d6\u94fe\u63a5\u65f6\u65e0\u6cd5\u643a\u5e26\u7528\u6237\u4fe1\u606f\uff0c\u9700\u8981jenkins\u670d\u52a1\u7aef\u5bf9\u666e\u901a\u7528\u6237\u5f00\u653e\u8bfb\u6743\u9650\uff0c<\/p>\n<p>\u65b9\u6cd51\u3001\u4f7f\u7528\u6b63\u786e\u7684\u8d26\u53f7\u5bc6\u7801\uff08Jenkins -&gt; \u7cfb\u7edf\u8bbe\u7f6e -&gt; \u5168\u5c40\u5b89\u5168\u8bbe\u7f6e-\u6388\u6743\u8868\u7b56\u7565\uff09\uff0c\u8be5\u8d26\u6237\u62e5\u6709\u8bbf\u95ee\u8be5Jenkins\u94fe\u63a5\u7684\u6743\u9650\uff08\u5efa\u8bae\uff09<\/p>\n<p>\u65b9\u6cd52\u3001\u6216\u9009\u62e9Jenkins -&gt; \u7cfb\u7edf\u8bbe\u7f6e -&gt; \u5168\u5c40\u5b89\u5168\u8bbe\u7f6e-&gt;\u6388\u6743\u7b56\u7565-&gt;anyone can do anything<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"739\" height=\"324\" class=\"alignnone wp-image-824 size-full\" src=\"http:\/\/www.rchen.top\/wp-content\/uploads\/2022\/06\/Pasted-94.png\" \/><\/p>\n<p><b>\u95ee\u9898<\/b><b>3<\/b><b>\u3001<\/b><b>j<\/b><b>enkins\u4fee\u6539<\/b><b>admin<\/b><b>\u6743\u9650\u540e\u65e0\u6cd5\u8fdb\u5165\u64cd\u4f5c\u754c\u9762\u8865\u6551<\/b><\/p>\n<p>\u5728jenkins\u5b89\u88c5\u76ee\u5f55\/root\/.jenkins\u627e\u5230config.xml<\/p>\n<p>\u6539\u4e3afalse<\/p>\n<p>&lt;useSecurity&gt;true&lt;\/useSecurity&gt;<\/p>\n<p>\u91cd\u542fjenkins<\/p>\n<p>systemctl restart tomcat<\/p>\n<p><b>\u95ee\u9898<\/b><b>4<\/b><b>\u3001<\/b><b>jenkens<\/b><b>\u6e90\u7801\u7ba1\u7406\u6dfb\u52a0<\/b><b>git<\/b><b>\u65f6<\/b><b>\u62a5\u9519Failed to connect to repository<\/b><\/p>\n<p><b>\u62a5\u9519\uff1a<\/b><\/p>\n<p>Failed to connect to repository : Command &#8220;git ls-remote -h <a href=\"https:\/\/gitlab.example.com\/root\/test-repo.git\">https:\/\/gitlab.example.com\/root\/test-repo.git<\/a> HEAD&#8221; returned status code 128:<\/p>\n<p>stdout:<\/p>\n<p>stderr: fatal: unable to access &#8216;<a href=\"https:\/\/gitlab.example.com\/root\/test-repo.git\/\">https:\/\/gitlab.example.com\/root\/test-repo.git\/<\/a>&#8216;: Peer&#8217;s certificate issuer has been marked as not trusted by the user.<\/p>\n<p>SSL certificate problem: unable to get local issuer certificate<\/p>\n<p><b>\u89e3\u51b3\u529e\u6cd5\uff1a<\/b><\/p>\n<p>\u539f\u56e0\u662f\u5728jenkins\u670d\u52a1\u5668\u4e0a\u6ca1\u6709\u5b89\u88c5git\u670d\u52a1\uff0c\u5728jenkins\u670d\u52a1\u5668\u4e2d\u5b89\u88c5git<\/p>\n<p>yum install \u2013y git<\/p>\n<p>\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p>git config &#8211;global http.sslVerify false<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"924\" height=\"442\" class=\"alignnone wp-image-825 size-full\" src=\"http:\/\/www.rchen.top\/wp-content\/uploads\/2022\/06\/Pasted-95.png\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u98981\u3001jenkins:\u914d\u7f6e\u5bc6\u94a5\u65f6\u62a5\u9519\u7684\u89e3\u51b3\uff1aFailed to add SSH key. Message i [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":752,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[95],"tags":[139],"class_list":["post-822","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-95","tag-jenkins"],"_links":{"self":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/822","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=822"}],"version-history":[{"count":1,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/822\/revisions"}],"predecessor-version":[{"id":826,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/posts\/822\/revisions\/826"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=\/wp\/v2\/media\/752"}],"wp:attachment":[{"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=822"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=822"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rchen.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=822"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}