{"id":252,"date":"2018-03-13T09:53:51","date_gmt":"2018-03-13T01:53:51","guid":{"rendered":"http:\/\/www.max-shu.com\/blog\/?p=252"},"modified":"2018-03-13T09:53:51","modified_gmt":"2018-03-13T01:53:51","slug":"securecrt%e4%bd%bf%e7%94%a8%e5%af%86%e9%92%a5key%e7%99%bb%e5%bd%95ssh%e6%9c%8d%e5%8a%a1%e5%99%a8","status":"publish","type":"post","link":"http:\/\/www.max-shu.com\/blog\/?p=252","title":{"rendered":"SecureCRT\u4f7f\u7528\u5bc6\u94a5key\u767b\u5f55SSH\u670d\u52a1\u5668"},"content":{"rendered":"<p>1.\u4f7f\u7528SecureCRT\u521b\u5efa\u79c1\u94a5\u548c\u516c\u94a5\uff1a<br \/>\nSecureCRT:Options-&gt; Global Options -&gt; Category: SSH2 -&gt; Create Identity File -&gt; DSA\/RSA -&gt; \u6309\u7167\u63d0\u793a\u64cd\u4f5c\u5b8c\u6210\u3002\u4fdd\u5b58\u7684\u65f6\u5019\u9009\u62e9OpenSSH\u683c\u5f0f\u7684key\uff0c\u5728\u6307\u5b9a\u76ee\u5f55\u4f1a\u751f\u6210\u4e24\u4e2a\u6587\u4ef6\uff0c\u4f8b\u5982\uff0c\u79c1\u94a5Identity\u548c\u516c\u94a5Identity.pub<\/p>\n<p>2.linux\u670d\u52a1\u5668\u4e0a\u5efa\u7acb.ssh\u76ee\u5f55,\u4e00\u822c\u60c5\u51b5\u4e0b,\u5df2\u7ecf\u6709\u8fd9\u4e2a\u76ee\u5f55\uff1a<br \/>\n# mkdir \/root\/.ssh<br \/>\n# chmod 700 \/root\/.ssh<\/p>\n<p>3.\u5c06\u516c\u94a5 Identity.pub \u4f20\u5230linux\u670d\u52a1\u5668\uff1a<br \/>\n\u4e0a\u9762\u4fdd\u5b58\u7684\u65f6\u5019\u5982\u679c\u6ca1\u9009OpenSSH\u683c\u5f0f\u7684\u8bdd\uff0c\u5c06SSH2\u517c\u5bb9\u683c\u5f0f\u7684\u516c\u94a5\u8f6c\u6362\u6210\u4e3aOpenssh\u517c\u5bb9\u683c\u5f0f\uff08\u5982\u679c\u662f\u79c1\u94a5\uff0c\u5219\u5fc5\u987b\u662f\u6ca1\u52a0\u5bc6\u7684\uff09\uff1a<br \/>\n# ssh-keygen -i -f Identity.pub &gt;&gt; \/root\/.ssh\/authorized_keys<br \/>\n# ssh-keygen -i -f Identity.pub &gt;&gt; \/root\/.ssh\/authorized_keys2<br \/>\n\u5982\u679c\u5df2\u7ecf\u662fOpenSSH\u683c\u5f0f\u7684\u8bdd\uff0c\u76f4\u63a5\u628a\u516c\u94a5\u52a0\u5165\u5230\u4e24\u4e2a\u9274\u6743\u6587\u4ef6\u4e2d\u3002<br \/>\n# cat Identity.pub &gt;&gt; \/root\/.ssh\/authorized_keys<br \/>\n# cat Identity.pub &gt;&gt; \/root\/.ssh\/authorized_keys2<br \/>\n# chmod 644 \/root\/.ssh\/authorized_keys<br \/>\n# chmod 644 \/root\/.ssh\/authorized_keys2<\/p>\n<p>4.\u5728SecureCRT\u91cc\u9762\u5bf9\u4e8e\u9700\u8981\u7528key\u767b\u5f55\u7684\u670d\u52a1\u5668\uff0c\u8bbe\u7f6e\u767b\u5f55\u6a21\u5f0f\u4e3aPublicKey\uff08\u8fde\u63a5\u8be5\u670d\u52a1\u5668\u7684\u5c5e\u6027Category: SSH2 -&gt;Authentication \u628aPublicKey\u79fb\u52a8\u5230\u6700\u4e0a\u9762\uff09\uff0c\u5982\u679c\u9700\u8981\u9009\u62e9\u79c1\u94a5\u7684\u8bdd\uff0c\u5c31\u9009\u62e9\u521a\u521a\u521b\u5efa\u7684 Identity \u6587\u4ef6\u79c1\u94a5\u3002<\/p>\n<p>5. \u7136\u540e\u7528SecureCRT\u5c31\u53ef\u4ee5\u767b\u5f55\u670d\u52a1\u5668\u4e86\uff0c\u4e0d\u7528\u8f93\u5165\u5bc6\u7801\uff0c\u53ef\u80fd\u9700\u8981\u8f93\u5165\u7528\u6237\u540d\u548c\u79c1\u94a5\u6587\u4ef6\u4f4d\u7f6e\u3002<\/p>\n<p>6.\u7531\u4e8e\u5df2\u7ecf\u8bbe\u7f6e\u4e86\u5bc6\u94a5\u767b\u5f55\uff0c\u670d\u52a1\u5668\u4e0a\u539f\u6765\u7684\u5bc6\u7801\u767b\u5f55\u5c31\u5b8c\u5168\u53ef\u4ee5\u53bb\u6389\uff1a<br \/>\n# vi \/etc\/ssh\/sshd_config<br \/>\nProtocol 2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u4ec5\u5141\u8bb8\u4f7f\u7528SSH2<br \/>\nPubkeyAuthentication yes\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u542f\u7528PublicKey\u8ba4\u8bc1<br \/>\nAuthorizedKeysFile .ssh\/authorized_keys #PublicKey\u6587\u4ef6\u8def\u5f84<br \/>\nPasswordAuthentication no\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #\u7981\u6b62\u5bc6\u7801\u9a8c\u8bc1\u767b\u5f55<\/p>\n<p>5.\u91cd\u542fLinux\u670d\u52a1\u5668\u4e0aSSH\u670d\u52a1\u5668\uff1a<br \/>\n# service sshd restart \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u6216\u8005:<br \/>\n# \/etc\/rc.d\/init.d\/sshd restart<\/p>\n<p>\u4ee5\u4e0a\u6b65\u9aa4\u662f\u4f7f\u7528SecureCRT\u751f\u6210\u7684\u5bc6\u94a5\u5bf9\u6765\u8fdb\u884c\u767b\u5f55\u9a8c\u8bc1\u7684\uff0c\u5176\u5b9e\u4e5f\u53ef\u4ee5\u5728\u670d\u52a1\u5668\u4e0a\u4f7f\u7528ssh-keygen\u547d\u4ee4\u751f\u6210\u7684\u5bc6\u94a5\uff0c\u56e0\u4e3aSecureCRT \u652f\u6301OpenSSH\u683c\u5f0f\u7684key\uff0c\u6240\u4ee5\u76f4\u63a5\u53ef\u4ee5\u4f7f\u7528ssh-keygen\u751f\u6210\u7684\u79c1\u94a5\u548c\u516c\u94a5\u3002<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1.\u4f7f\u7528SecureCRT\u521b\u5efa\u79c1\u94a5\u548c\u516c\u94a5\uff1a SecureCRT:Options-&gt; Global Opt &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[172,103,101,173,174],"class_list":["post-252","post","type-post","status-publish","format-standard","hentry","category-linuxandroid","tag-key","tag-securecrt","tag-ssh","tag-173","tag-174"],"views":2670,"_links":{"self":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/252","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=252"}],"version-history":[{"count":1,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/252\/revisions"}],"predecessor-version":[{"id":253,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/252\/revisions\/253"}],"wp:attachment":[{"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=252"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=252"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.max-shu.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=252"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}