{"id":96,"date":"2026-01-22T06:27:34","date_gmt":"2026-01-22T06:27:34","guid":{"rendered":"https:\/\/blog.gpst.net.cn:4008\/?p=96"},"modified":"2026-01-28T06:24:16","modified_gmt":"2026-01-28T06:24:16","slug":"%e9%80%9a%e8%bf%87-sshpass-%e8%af%bb%e5%8f%96%e6%a0%87%e5%87%86%e8%be%93%e5%85%a5%e7%9a%84%e5%af%86%e7%a0%81%ef%bc%8c%e5%85%8d%e4%ba%a4%e4%ba%92%e7%99%bb%e5%bd%95%e5%88%b0%e8%bf%9c%e7%a8%8b%e6%9c%8d","status":"publish","type":"post","link":"https:\/\/opshub.com.cn\/?p=96","title":{"rendered":"\u901a\u8fc7 sshpass \u8bfb\u53d6\u6807\u51c6\u8f93\u5165\u7684\u5bc6\u7801\uff0c\u514d\u4ea4\u4e92\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u5e76\u6267\u884c\u6307\u5b9a\u7684 \u201c\u547d\u4ee4\u201d"},"content":{"rendered":"\n<p><code>echo \"Gaoyangsray\" |sshpass -d0 ssh -4 -o StrictHostKeyChecking=no -o UserKnownHostsFile=\/dev\/null -o PasswordAuthentication=yes -o PubkeyAuthentication=no&nbsp; -o RSAAuthentication=no root@${IPADDR2006} \"\u547d\u4ee4\"<\/code><\/p>\n\n\n\n<p>\u8865\u5145\u8bf4\u660e\uff1a<\/p>\n\n\n\n<p>StrictHostKeyChecking=no \u9996\u6b21\u8fde\u63a5\u8fdc\u7a0b\u4e3b\u673a\u65f6\uff0c\u4f1a\u81ea\u52a8\u5c06\u4e3b\u673a\u5bc6\u94a5\u52a0\u5165 <code>KnownHostsFile<\/code>\uff08\u4f46\u8fd9\u91cc\u6307\u5b9a\u4e86 <code>\/dev\/null<\/code>\uff0c\u6240\u4ee5\u4e0d\u4f1a\u4fdd\u5b58\uff09\uff0c\u907f\u514d\u811a\u672c\u5361\u5728 \u201c\u662f\u5426\u4fe1\u4efb\u4e3b\u673a\u201d \u7684\u4ea4\u4e92\u63d0\u793a\u3002<\/p>\n\n\n\n<p>UserKnownHostsFile=\/dev\/null \u4e0d\u4fdd\u5b58\u8fdc\u7a0b\u4e3b\u673a\u7684\u516c\u94a5\u5230\u672c\u5730\uff0c\u89e3\u51b3 \u201c\u4e3b\u673a\u5bc6\u94a5\u53d8\u66f4\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u201d \u7684\u95ee\u9898\uff08\u6bd4\u5982 ESXi \u91cd\u88c5\u540e\u516c\u94a5\u53d8\u5316\uff09\uff0c\u4f46<strong>\u751f\u4ea7\u73af\u5883\u614e\u7528<\/strong>\uff08\u6709\u4e2d\u95f4\u4eba\u653b\u51fb\u98ce\u9669\uff09\u3002<\/p>\n\n\n\n<p><code>PubkeyAuthentication=no\u3001<\/code><code>RSAAuthentication=no<\/code>\u5f7b\u5e95\u7981\u7528\u516c\u94a5\u8ba4\u8bc1\uff1a- <code>RSAAuthentication=no<\/code> \u662f\u9488\u5bf9\u8001\u7248\u672c SSH \u7684 RSA \u516c\u94a5\u8ba4\u8bc1\uff1b- <code>PubkeyAuthentication=no<\/code> \u662f\u901a\u7528\u7684\u516c\u94a5\u8ba4\u8bc1\u5f00\u5173\uff1b\u4e24\u8005\u540c\u65f6\u7981\u7528\uff0c\u5f3a\u5236 SSH \u53ea\u7528\u5bc6\u7801\u767b\u5f55\uff0c\u907f\u514d\u672c\u5730\u6709\u516c\u94a5\u65f6\u4f18\u5148\u8d70\u516c\u94a5\u8ba4\u8bc1\u5bfc\u81f4\u5931\u8d25\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>echo &#8220;Gaoyangsray&#8221; |sshpass -d0 ssh -4 -o StrictHostKeyChecking=no -o UserKnownHostsFile=\/dev\/null -o PasswordAuthentication=yes -o PubkeyAuthentication=no&nbsp; -o RSAAuthentication=no root@${IPADDR2006} &#8220;\u547d\u4ee4&#8221; \u8865\u5145\u8bf4\u660e\uff1a StrictHostKeyChecking=no \u9996\u6b21\u8fde\u63a5\u8fdc\u7a0b\u4e3b\u673a\u65f6\uff0c\u4f1a\u81ea\u52a8\u5c06\u4e3b\u673a\u5bc6\u94a5\u52a0\u5165 KnownHostsFile\uff08\u4f46\u8fd9\u91cc\u6307\u5b9a\u4e86 \/dev\/null\uff0c\u6240\u4ee5\u4e0d\u4f1a\u4fdd\u5b58\uff09\uff0c\u907f\u514d\u811a\u672c\u5361\u5728 \u201c\u662f\u5426\u4fe1\u4efb\u4e3b\u673a\u201d \u7684\u4ea4\u4e92\u63d0\u793a\u3002 UserKnownHostsFile=\/dev\/null \u4e0d\u4fdd\u5b58\u8fdc\u7a0b\u4e3b\u673a\u7684\u516c\u94a5\u5230\u672c\u5730\uff0c\u89e3\u51b3 \u201c\u4e3b\u673a\u5bc6\u94a5\u53d8\u66f4\u5bfc\u81f4\u8fde\u63a5\u5931\u8d25\u201d \u7684\u95ee\u9898\uff08\u6bd4\u5982 ESXi \u91cd\u88c5\u540e\u516c\u94a5\u53d8\u5316\uff09\uff0c\u4f46\u751f\u4ea7\u73af\u5883\u614e\u7528\uff08\u6709\u4e2d\u95f4\u4eba\u653b\u51fb\u98ce\u9669\uff09\u3002 PubkeyAuthentication=no\u3001RSAAuthentication=no\u5f7b\u5e95\u7981\u7528\u516c\u94a5\u8ba4\u8bc1\uff1a- RSAAuthentication=no \u662f\u9488\u5bf9\u8001\u7248\u672c SSH \u7684 RSA \u516c\u94a5\u8ba4\u8bc1\uff1b- PubkeyAuthentication=no \u662f\u901a\u7528\u7684\u516c\u94a5\u8ba4\u8bc1\u5f00\u5173\uff1b\u4e24\u8005\u540c\u65f6\u7981\u7528\uff0c\u5f3a\u5236 SSH \u53ea\u7528\u5bc6\u7801\u767b\u5f55\uff0c\u907f\u514d\u672c\u5730\u6709\u516c\u94a5\u65f6\u4f18\u5148\u8d70\u516c\u94a5\u8ba4\u8bc1\u5bfc\u81f4\u5931\u8d25\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-96","post","type-post","status-publish","format-standard","hentry","category-9"],"_links":{"self":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/96","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=96"}],"version-history":[{"count":3,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions"}],"predecessor-version":[{"id":103,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=\/wp\/v2\/posts\/96\/revisions\/103"}],"wp:attachment":[{"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=96"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=96"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/opshub.com.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=96"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}