{"id":100,"date":"2019-02-10T17:46:01","date_gmt":"2019-02-10T09:46:01","guid":{"rendered":"http:\/\/b.yesiyu.top\/?p=100"},"modified":"2019-02-10T17:46:01","modified_gmt":"2019-02-10T09:46:01","slug":"linux-%e8%bf%9c%e7%a8%8b%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"https:\/\/b.yesiyu.top\/?p=100","title":{"rendered":"Linux \u8fdc\u7a0b\u767b\u5f55"},"content":{"rendered":"<h1><span class=\"color_h1\">Linux\u00a0<\/span>\u8fdc\u7a0b\u767b\u5f55<\/h1>\n<p>Linux\u4e00\u822c\u4f5c\u4e3a\u670d\u52a1\u5668\u4f7f\u7528\uff0c\u800c\u670d\u52a1\u5668\u4e00\u822c\u653e\u5728\u673a\u623f\uff0c\u4f60\u4e0d\u53ef\u80fd\u5728\u673a\u623f\u64cd\u4f5c\u4f60\u7684Linux\u670d\u52a1\u5668\u3002<\/p>\n<p>\u8fd9\u65f6\u6211\u4eec\u5c31\u9700\u8981\u8fdc\u7a0b\u767b\u5f55\u5230Linux\u670d\u52a1\u5668\u6765\u7ba1\u7406\u7ef4\u62a4\u7cfb\u7edf\u3002<\/p>\n<p>Linux\u7cfb\u7edf\u4e2d\u662f\u901a\u8fc7ssh\u670d\u52a1\u5b9e\u73b0\u7684\u8fdc\u7a0b\u767b\u5f55\u529f\u80fd\uff0c\u9ed8\u8ba4ssh\u670d\u52a1\u7aef\u53e3\u53f7\u4e3a 22\u3002<\/p>\n<p>Window\u7cfb\u7edf\u4e0a Linux \u8fdc\u7a0b\u767b\u5f55\u5ba2\u6237\u7aef\u6709SecureCRT, Putty, SSH Secure Shell\u7b49\uff0c\u672c\u6587\u4ee5Putty\u4e3a\u4f8b\u6765\u767b\u5f55\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<p>putty\u4e0b\u8f7d\u5730\u5740\uff1a<a href=\"http:\/\/www.putty.org\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.putty.org\/<\/a><\/p>\n<p>\u5982\u679c\u4f60\u4e0b\u8f7d\u4e86putty\uff0c\u8bf7\u53cc\u51fbputty.exe \u7136\u540e\u5f39\u51fa\u5982\u4e0b\u7684\u7a97\u53e3\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_1.png\" alt=\"5_1\" width=\"458\" height=\"437\" \/><\/p>\n<p>\u5728Host Name( or IP address)\u00a0\u4e0b\u9762\u7684\u6846\u4e2d\u8f93\u5165\u4f60\u8981\u767b\u5f55\u7684\u8fdc\u7a0b\u670d\u52a1\u5668IP(\u53ef\u4ee5\u901a\u8fc7ifconfig\u547d\u4ee4\u67e5\u770b\u670d\u52a1\u5668ip)\uff0c\u7136\u540e\u56de\u8f66\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_12.png\" alt=\"5_12\" width=\"456\" height=\"434\" \/><\/p>\n<p>\u6b64\u65f6\uff0c\u63d0\u793a\u6211\u4eec\u8f93\u5165\u8981\u767b\u5f55\u7684\u7528\u6237\u540d\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_13.png\" alt=\"5_13\" width=\"663\" height=\"415\" \/><\/p>\n<p>\u8f93\u5165root\u00a0\u7136\u540e\u56de\u8f66\uff0c\u518d\u8f93\u5165\u5bc6\u7801\uff0c\u5c31\u80fd\u767b\u5f55\u5230\u8fdc\u7a0b\u7684linux\u7cfb\u7edf\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_14.png\" alt=\"5_14\" width=\"665\" height=\"118\" \/><\/p>\n<hr \/>\n<h2>\u4f7f\u7528\u5bc6\u94a5\u8ba4\u8bc1\u673a\u5236\u8fdc\u7a0b\u767b\u5f55linux<\/h2>\n<p>SSH \u4e3a Secure Shell \u7684\u7f29\u5199\uff0c\u7531 IETF \u7684\u7f51\u7edc\u5de5\u4f5c\u5c0f\u7ec4\uff08Network Working Group\uff09\u6240\u5236\u5b9a\u3002<\/p>\n<p>SSH \u4e3a\u5efa\u7acb\u5728\u5e94\u7528\u5c42\u548c\u4f20\u8f93\u5c42\u57fa\u7840\u4e0a\u7684\u5b89\u5168\u534f\u8bae\u3002<\/p>\n<p>\u9996\u5148\u4f7f\u7528\u5de5\u5177\u00a0PUTTYGEN.EXE\u00a0\u751f\u6210\u5bc6\u94a5\u5bf9\u3002\u6253\u5f00\u5de5\u5177PUTTYGEN.EXE\u540e\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_15.png\" alt=\"5_15\" width=\"483\" height=\"468\" \/><\/p>\n<p>\u8be5\u5de5\u5177\u53ef\u4ee5\u751f\u6210\u4e09\u79cd\u683c\u5f0f\u7684key\u00a0\uff1aSSH-1(RSA) SSH-2(RSA) SSH-2(DSA)\u00a0\uff0c\u6211\u4eec\u91c7\u7528\u9ed8\u8ba4\u7684\u683c\u5f0f\u5373SSH-2(RSA)\u3002Number of bits in a generated key\u00a0\u8fd9\u4e2a\u662f\u6307\u751f\u6210\u7684key\u7684\u5927\u5c0f\uff0c\u8fd9\u4e2a\u6570\u503c\u8d8a\u5927\uff0c\u751f\u6210\u7684key\u5c31\u8d8a\u590d\u6742\uff0c\u5b89\u5168\u6027\u5c31\u8d8a\u9ad8\u3002\u8fd9\u91cc\u6211\u4eec\u51992048.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_16.png\" alt=\"5_16\" width=\"476\" height=\"92\" \/><\/p>\n<p>\u7136\u540e\u5355\u51fbGenerate\u00a0\u5f00\u59cb\u751f\u6210\u5bc6\u94a5\u5bf9\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_17.png\" alt=\"5_17\" width=\"465\" height=\"92\" \/><\/p>\n<p>\u6ce8\u610f\u7684\u662f\uff0c\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u9f20\u6807\u8981\u6765\u56de\u7684\u52a8\uff0c\u5426\u5219\u8fd9\u4e2a\u8fdb\u5ea6\u6761\u662f\u4e0d\u4f1a\u52a8\u7684\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_18.png\" alt=\"5_18\" width=\"482\" height=\"459\" \/><\/p>\n<p>\u5230\u8fd9\u91cc\uff0c\u5bc6\u94a5\u5bf9\u5df2\u7ecf\u751f\u6210\u4e86\u3002\u4f60\u53ef\u4ee5\u7ed9\u4f60\u7684\u5bc6\u94a5\u8f93\u5165\u4e00\u4e2a\u5bc6\u7801\uff0c\uff08\u5728Key Passphrase\u90a3\u91cc\uff09\u4e5f\u53ef\u4ee5\u7559\u7a7a\u3002\u7136\u540e\u70b9\u00a0Save public key\u00a0\u4fdd\u5b58\u516c\u94a5\uff0c\u70b9\u00a0Save private Key\u00a0\u4fdd\u5b58\u79c1\u94a5\u3002\u7b14\u8005\u5efa\u8bae\u4f60\u653e\u5230\u4e00\u4e2a\u6bd4\u8f83\u5b89\u5168\u7684\u5730\u65b9\uff0c\u4e00\u6765\u9632\u6b62\u522b\u4eba\u5077\u7aa5\uff0c\u4e8c\u6765\u9632\u6b62\u8bef\u5220\u9664\u3002\u63a5\u4e0b\u6765\u5c31\u8be5\u5230\u8fdc\u7a0blinux\u4e3b\u673a\u4e0a\u8bbe\u7f6e\u4e86\u3002<\/p>\n<p>1\uff09\u521b\u5efa\u76ee\u5f55\u00a0\/root\/.ssh\u00a0\u5e76\u8bbe\u7f6e\u6743\u9650<\/p>\n<p>[root@localhost ~]# mkdir \/root\/.ssh mkdir\u00a0\u547d\u4ee4\u7528\u6765\u521b\u5efa\u76ee\u5f55\uff0c\u4ee5\u540e\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u6682\u65f6\u53ea\u4e86\u89e3\u5373\u53ef\u3002<\/p>\n<p>[root@localhost ~]# chmod 700 \/root\/.ssh chmod\u00a0\u547d\u4ee4\u662f\u7528\u6765\u4fee\u6539\u6587\u4ef6\u5c5e\u6027\u6743\u9650\u7684\uff0c\u4ee5\u540e\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n<p>2\uff09\u521b\u5efa\u6587\u4ef6\u00a0\/ root\/.ssh\/authorized_keys<\/p>\n<p>[root@localhost ~]# vim \/root\/.ssh\/authorized_keys vim\u00a0\u547d\u4ee4\u662f\u7f16\u8f91\u4e00\u4e2a\u6587\u672c\u6587\u4ef6\u7684\u547d\u4ee4\uff0c\u540c\u6837\u5728\u540e\u7eed\u7ae0\u8282\u8be6\u7ec6\u4ecb\u7ecd\u3002<\/p>\n<p>3\uff09\u6253\u5f00\u521a\u624d\u751f\u6210\u7684public key\u00a0\u6587\u4ef6\uff0c\u5efa\u8bae\u4f7f\u7528\u5199\u5b57\u677f\u6253\u5f00\uff0c\u8fd9\u6837\u770b\u7740\u8212\u670d\u4e00\u4e9b\uff0c\u590d\u5236\u4eceAAAA\u5f00\u5934\u81f3\u00a0&#8220;&#8212;- END SSH2 PUBLIC KEY &#8212;-&#8221;\u00a0\u8be5\u884c\u4e0a\u7684\u6240\u6709\u5185\u5bb9\uff0c\u7c98\u8d34\u5230\/root\/.ssh\/authorized_keys\u00a0\u6587\u4ef6\u4e2d\uff0c\u8981\u4fdd\u8bc1\u6240\u6709\u5b57\u7b26\u5728\u4e00\u884c\u3002\uff08\u53ef\u4ee5\u5148\u628a\u590d\u5236\u7684\u5185\u5bb9\u62f7\u8d1d\u81f3\u8bb0\u4e8b\u672c\uff0c\u7136\u540e\u7f16\u8f91\u6210\u4e00\u884c\u8f7d\u7c98\u8d34\u5230\u8be5\u6587\u4ef6\u4e2d\uff09\u3002<\/p>\n<p>\u5728\u8fd9\u91cc\u8981\u7b80\u5355\u4ecb\u7ecd\u4e00\u4e0b\uff0c\u5982\u4f55\u7c98\u8d34\uff0c\u7528vim\u6253\u5f00\u90a3\u4e2a\u6587\u4ef6\u540e\uff0c\u8be5\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u6240\u4ee5vim\u4f1a\u81ea\u52a8\u521b\u5efa\u3002\u6309\u4e00\u4e0b\u5b57\u6bcd&#8221;i&#8221;\u7136\u540e\u540c\u65f6\u6309shift + Insert\u00a0\u8fdb\u884c\u7c98\u8d34\uff08\u6216\u8005\u5355\u51fb\u9f20\u6807\u53f3\u952e\u5373\u53ef\uff09\uff0c\u524d\u63d0\u662f\u5df2\u7ecf\u590d\u5236\u5230\u526a\u5207\u677f\u4e2d\u4e86\u3002\u7c98\u8d34\u597d\u540e\uff0c\u7136\u540e\u628a\u5149\u6807\u79fb\u52a8\u5230\u8be5\u884c\u6700\u524d\u9762\u8f93\u5165\u00a0<strong>ssh-rsa<\/strong>\u00a0\uff0c\u7136\u540e\u6309\u7a7a\u683c\u3002\u518d\u6309ESC\uff0c\u7136\u540e\u8f93\u5165\u5192\u53f7wq\u00a0\u5373\u00a0:wq\u00a0\u5c31\u4fdd\u5b58\u4e86\u3002\u683c\u5f0f\u5982\u4e0b\u56fe\uff1a<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_19.png\" alt=\"5_19\" width=\"736\" height=\"412\" \/><\/p>\n<p>4\uff09\u518d\u8bbe\u7f6eputty\u9009\u9879\uff0c\u70b9\u7a97\u53e3\u5de6\u4fa7\u7684SSh \u2013&gt; Auth\u00a0\uff0c\u5355\u51fb\u7a97\u53e3\u53f3\u4fa7\u7684Browse\u2026\u00a0\u9009\u62e9\u521a\u521a\u751f\u6210\u7684\u79c1\u94a5\uff0c\u00a0\u518d\u70b9Open\u00a0\uff0c\u6b64\u65f6\u8f93\u5165root\uff0c\u5c31\u4e0d\u7528\u8f93\u5165\u5bc6\u7801\u5c31\u80fd\u767b\u5f55\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"attachment-full\" src=\"http:\/\/www.runoob.com\/wp-content\/uploads\/2014\/06\/5_20.png\" alt=\"5_20\" width=\"455\" height=\"435\" \/><\/p>\n<p>\u5982\u679c\u5728\u524d\u9762\u4f60\u8bbe\u7f6e\u4e86Key Passphrase\u00a0\uff0c\u90a3\u4e48\u6b64\u65f6\u5c31\u4f1a\u63d0\u793a\u4f60\u8f93\u5165\u5bc6\u7801\u7684\u3002\u4e3a\u4e86\u66f4\u52a0\u5b89\u5168\u5efa\u8bae\u5927\u5bb6\u8981\u8bbe\u7f6e\u4e00\u4e2aKey Passphrase\u3002<\/p>\n<p><strong>\u7ec8\u7aef\u5229\u7528ssh\u767b\u5f55\u8fdc\u7a0b\u670d\u52a1\u5668<\/strong><\/p>\n<p>\u5b89\u88c5ssh\uff1a<\/p>\n<pre class=\"prettyprint prettyprinted\"><span class=\"pln\">yum install ssh<\/span><\/pre>\n<p>\u542f\u52a8ssh\uff1a<\/p>\n<pre class=\"prettyprint prettyprinted\"><span class=\"pln\">service sshd start<\/span><\/pre>\n<p>\u767b\u5f55\u8fdc\u7a0b\u670d\u52a1\u5668\uff1a<\/p>\n<pre class=\"prettyprint prettyprinted\"><span class=\"pln\">ssh <\/span><span class=\"pun\">-<\/span><span class=\"pln\">p <\/span><span class=\"lit\">50022<\/span> <span class=\"kwd\">my<\/span><span class=\"pun\">@<\/span><span class=\"lit\">127.0<\/span><span class=\"pun\">.<\/span><span class=\"lit\">0.1<\/span>\r\n<span class=\"pun\">\u8f93\u5165\u5bc6\u7801\uff1a<\/span>\r\n<span class=\"kwd\">my<\/span><span class=\"pun\">@<\/span><span class=\"lit\">127.0<\/span><span class=\"pun\">.<\/span><span class=\"lit\">0.1<\/span><span class=\"pun\">:<\/span><\/pre>\n<p><strong>-p<\/strong>\u00a0\u540e\u9762\u662f\u7aef\u53e3<\/p>\n<p><strong>my<\/strong>\u00a0\u662f\u670d\u52a1\u5668\u7528\u6237\u540d<\/p>\n<p><strong>127.0.0.1<\/strong>\u00a0\u662f\u670d\u52a1\u5668 ip<\/p>\n<p>\u56de\u8f66\u8f93\u5165\u5bc6\u7801\u5373\u53ef\u767b\u5f55<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u00a0\u8fdc\u7a0b\u767b\u5f55 Linux\u4e00\u822c\u4f5c\u4e3a\u670d\u52a1\u5668\u4f7f\u7528\uff0c\u800c\u670d\u52a1\u5668\u4e00\u822c\u653e\u5728\u673a\u623f\uff0c\u4f60\u4e0d\u53ef\u80fd\u5728\u673a\u623f\u64cd\u4f5c\u4f60\u7684Linux\u670d\u52a1 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/b.yesiyu.top\/?p=100\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cLinux \u8fdc\u7a0b\u767b\u5f55\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-liunx-"],"_links":{"self":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":1,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":101,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/101"}],"wp:attachment":[{"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/b.yesiyu.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}