{"id":1054,"date":"2015-02-02T15:01:41","date_gmt":"2015-02-02T07:01:41","guid":{"rendered":"http:\/\/hesiwei.cn\/?p=1054"},"modified":"2015-02-02T15:01:41","modified_gmt":"2015-02-02T07:01:41","slug":"ssh%e8%ae%a4%e8%af%81%e5%85%8d%e5%af%86%e7%a0%81%e7%99%bb%e5%bd%95","status":"publish","type":"post","link":"http:\/\/hesiwei.cn\/?p=1054","title":{"rendered":"SSH\u8ba4\u8bc1\u514d\u5bc6\u7801\u767b\u5f55"},"content":{"rendered":"<p>\u5ba2\u6237\u7aef\uff1a<\/p>\n<p>#ssh-keygen -t rsa<\/p>\n<p>Generating public\/private rsa key pair.<\/p>\n<p>Enter file in which to save the key (\/Users\/hisway\/.ssh\/id_rsa):<\/p>\n<p>Enter passphrase (empty for no passphrase):<\/p>\n<p>Enter same passphrase again:<\/p>\n<p>Your identification has been saved in \/Users\/hisway\/.ssh\/id_rsa.<\/p>\n<p>Your public key has been saved in \/Users\/hisway\/.ssh\/id_rsa.pub.<\/p>\n<p>The key fingerprint is:<\/p>\n<p>0d:24:c6:8d:f0:d9:b2:01:08:67:89:8a:5f:20:8e:b7 hisway@hisway.lan<\/p>\n<p>The key&#8217;s randomart image is:<\/p>\n<p>+&#8211;[ RSA 2048]&#8212;-+<\/p>\n<p>|.ooooooo. \u00a0 \u00a0 \u00a0 \u00a0|<\/p>\n<p>|oo+ \u00a0+o=. \u00a0 \u00a0 \u00a0 \u00a0|<\/p>\n<p>|=. . \u00a0= o \u00a0 \u00a0 \u00a0 \u00a0|<\/p>\n<p>|+.. . \u00a0+ o \u00a0 \u00a0 \u00a0 |<\/p>\n<p>| o o \u00a0. S . \u00a0 \u00a0 \u00a0|<\/p>\n<p>| \u00a0E \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 |<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 |<\/p>\n<p>| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 |<\/p>\n<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<\/p>\n<p>#scp \/Users\/hisway\/.ssh\/id_rsa.pub \u00a0root@162.243.*.*:\/home\/root\/id_rsa.pub<\/p>\n<p>\u670d\u52a1\u7aef\uff1a<\/p>\n<p>#cat id_rsa.pub &gt;&gt;\/root\/.ssh\/authorized_keys<\/p>\n<p># vi \/etc\/ssh\/sshd_config<\/p>\n<p>\u200b<\/p>\n<p>RSAAuthentication yes<\/p>\n<p>#RSA\u8ba4\u8bc1<\/p>\n<p>PubkeyAuthentication yes<\/p>\n<p>#\u5f00\u542f\u516c\u94a5\u9a8c\u8bc1<\/p>\n<p>AuthorizedKeysFile \u00a0 \u00a0.ssh\/authorized_keys<\/p>\n<p>#\u9a8c\u8bc1\u6587\u4ef6\u8def\u5f84<\/p>\n<p>PasswordAuthentication no<\/p>\n<p>#\u7981\u6b62\u5bc6\u7801\u8ba4\u8bc1<\/p>\n<p>PermitEmptyPasswords no<\/p>\n<p>#\u7981\u6b62\u7a7a\u5bc6\u7801<\/p>\n<p>UsePAM no<\/p>\n<p>#\u7981\u7528PAM<\/p>\n<p>\u6700\u540e\u4fdd\u5b58\uff0c\u91cd\u542f<\/p>\n<p>#<\/p>\n<pre>service sshd restart<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5ba2\u6237\u7aef\uff1a #ssh-keygen -t rsa Generating public\/private rsa k [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-1054","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/1054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1054"}],"version-history":[{"count":0,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=\/wp\/v2\/posts\/1054\/revisions"}],"wp:attachment":[{"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1054"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/hesiwei.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}