{"id":2233,"date":"2021-09-26T14:25:18","date_gmt":"2021-09-26T06:25:18","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=2233"},"modified":"2021-09-26T14:25:18","modified_gmt":"2021-09-26T06:25:18","slug":"%e5%85%b3%e4%ba%8etranswarp%e8%b4%a6%e5%8f%b7%e6%97%a0%e7%a7%98%e9%92%a5%e7%99%bb%e5%bd%95%e5%a4%b1%e8%b4%a5%e9%97%ae%e9%a2%98%e6%8e%92%e6%9f%a5%e6%80%9d%e8%b7%af","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=2233","title":{"rendered":"\u5173\u4e8etranswarp\u8d26\u53f7\u65e0\u79d8\u94a5\u767b\u5f55\u5931\u8d25\u95ee\u9898\u6392\u67e5\u601d\u8def"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<p>transwarp\u8d26\u53f7\u7684\u65e0\u5bc6\u7801\u767b\u9646\u5982\u679c\u6709\u95ee\u9898\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5347\u7ea7\u5931\u8d25\u3001TDH\u5de1\u68c0\u62a5\u544a\u767b\u9646\u5404\u4e2a\u8282\u70b9\u51fa\u9519\u3002<\/p>\n<p>\u672c\u6587\u63cf\u8ff0transwarp\u8d26\u53f7\u65e0\u5bc6\u7801\u8fde\u63a5\u51fa\u73b0\u95ee\u9898\u540e\u7684\u6392\u67e5\u601d\u8def\u3002<\/p>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<h4>1 \u68c0\u67e5\u7528\u6237\u548c\u7528\u6237\u7ec4\u662f\u5426\u5b58\u5728<\/h4>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# getent group transwarp\ntranswarp:x:994:\n[root@mll01 TDH-Client]# getent passwd transwarp\ntranswarp:x:996:994:Transwarp Data Hub:\/home\/transwarp:\/bin\/bash\n<\/code><\/pre>\n<p>\u5982\u679c\u4e0d\u5b58\u5728\uff0c\u5219\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c\u6dfb\u52a0\uff1a<\/p>\n<p>\u6dfb\u52a0transwarp\u7ec4<\/p>\n<pre><code class=\"language-shell\">groupadd -r transwarp<\/code><\/pre>\n<p>\u6dfb\u52a0transwarp\u8d26\u53f7<\/p>\n<pre><code class=\"language-shell\">useradd -c \u2018Default user to execute inspection\u2019 -s \/bin\/bash -g transwarp -r -d \/home\/transwarp transwarp\n<\/code><\/pre>\n<h4>2 \u68c0\u67e5\u7528\u6237\u662f\u5426\u5177\u6709 sudo \u6743\u9650\uff0c\u4e14\u5fc5\u987b\u662f NOPASSWD sudoer<\/h4>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# cat \/etc\/sudoers | grep transwarp\ntranswarp      ALL=(ALL)       NOPASSWD: ALL\n<\/code><\/pre>\n<p>\u5982\u679c\u6ca1\u6709\u5219\u9700\u8981\u6dfb\u52a0<\/p>\n<h4>3 \u68c0\u67e5\u96c6\u7fa4\u5404\u4e2a\u8282\u70b9\/home\/transwarp\/.ssh \u5404\u7ea7\u76ee\u5f55\u548c\u6587\u4ef6\u7684\u6743\u9650\u548c owner \u662f\u5426\u6b63\u786e<\/h4>\n<pre><code class=\"language-shell\">ls -la \/home\/transwarp\/.ssh<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581321598336.png\" alt=\"file\" \/><\/p>\n<h4>4 \u68c0\u67e5\u5404\u4e2a\u8282\u70b9 \/home\/transwarp\/.ssh\/authorized_keys \u7684\u5185\u5bb9\u662f\u5426\u5305\u542b manager \u8282\u70b9\u7684 \/etc\/transwarp\/transwarp-id_rsa.pub \u7684\u516c\u94a5<\/h4>\n<p>\u67e5\u770b\u516c\u94a5\u4fe1\u606f<\/p>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# cat \/etc\/transwarp\/transwarp-id_rsa.pub<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581322109198.png\" alt=\"file\" \/><\/p>\n<p>\u67e5\u770b\u96c6\u7fa4\u6bcf\u4e2a\u8282\u70b9\u7684authorized_keys\u4fe1\u606f<\/p>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# cat \/home\/transwarp\/.ssh\/authorized_keys<\/code><\/pre>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581322189633.png\" alt=\"file\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581322499464.png\" alt=\"file\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581322523865.png\" alt=\"file\" \/><\/p>\n<h4>5 \u68c0\u67e5manager\u8282\u70b9\u7684\u516c\u79c1\u94a5\u6743\u9650\u662f\u5426\u6b63\u786e<\/h4>\n<pre><code class=\"language-shell\"> ls -al \/etc\/transwarp\/<\/code><\/pre>\n<p>\u516c\u79c1\u94a5\u6587\u4ef6\u7684\u6743\u9650\u4e0d\u80fd\u8bbe\u7f6e\u7684\u66f4\u5927\uff0cowner \u4e5f\u5fc5\u987b\u90fd\u662f root:root<br \/>\n<img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/02\/image-1581322666417.png\" alt=\"file\" \/><\/p>\n<h4>6 \u68c0\u67e5 manager \u8282\u70b9\u7684\u516c\u79c1\u94a5\u683c\u5f0f\u662f\u5426\u6b63\u786e\uff0c\u4ee5\u53ca\u5185\u5bb9\u662f\u5426\u5339\u914d<\/h4>\n<p>\u68c0\u67e5\u79c1\u94a5\u683c\u5f0f\u662f\u5426\u6b63\u786e\uff0c\u201cecho $?\u201d\u7ed3\u679c\u4e3a 0 \u8868\u793a\u6b63\u786e<\/p>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# openssl rsa -in \/etc\/transwarp\/transwarp-id_rsa -text -noout > \/dev\/null\n[root@mll01 TDH-Client]# echo $?\n0<\/code><\/pre>\n<p>\u68c0\u67e5\u516c\u94a5\u5185\u5bb9\u662f\u5426\u6b63\u786e\uff0c\u201cecho $?\u201d\u7ed3\u679c\u4e3a 0 \u8868\u793a\u6b63\u786e<\/p>\n<pre><code class=\"language-shell\">[root@mll01 TDH-Client]# ssh-keygen -y -f \/etc\/transwarp\/transwarp-id_rsa > \/tmp\/transwarp-id_rsa.pub.tobecompared\n[root@mll01 TDH-Client]# eval [ \u201c$(cat \/etc\/transwarp\/transwarp-id_rsa.pub | awk '{print $2}')\u201d == \u201c$(cat \/tmp\/transwarp-id_rsa.pub.tobecompared | awk '{print $2}')\u201d ]\n[root@mll01 TDH-Client]# echo $?\n0<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 transwarp\u8d26\u53f7\u7684\u65e0\u5bc6\u7801\u767b\u9646\u5982\u679c\u6709\u95ee\u9898\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5347\u7ea7\u5931\u8d25\u3001TDH\u5de1\u68c0\u62a5\u544a\u767b\u9646\u5404\u4e2a\u8282\u70b9\u51fa\u9519\u3002  ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=2233\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":15,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2233","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/15"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2233"}],"version-history":[{"count":4,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2233\/revisions"}],"predecessor-version":[{"id":11375,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2233\/revisions\/11375"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}