{"id":3946,"date":"2019-07-21T23:35:53","date_gmt":"2019-07-21T15:35:53","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=3946"},"modified":"2022-06-05T16:17:48","modified_gmt":"2022-06-05T08:17:48","slug":"ssh-keygen","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/ssh-keygen","title":{"rendered":"ssh-keygen\u547d\u4ee4 – \u751f\u6210SSH\u5bc6\u94a5\u6587\u4ef6"},"content":{"rendered":"\n

ssh-keygen\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cSSH key generate\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u751f\u6210SSH\u5bc6\u94a5\u6587\u4ef6\u3002ssh-keygen\u547d\u4ee4\u80fd\u591f\u5bf9SSH\u5bc6\u94a5\u6587\u4ef6\u8fdb\u884c\u751f\u6210\u3001\u7ba1\u7406\u3001\u8f6c\u6362\u7b49\u5de5\u4f5c\uff0c\u652f\u6301RSA\u548cDSA\u4e24\u79cd\u5bc6\u94a5\u683c\u5f0f\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>ssh-keygen [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-b<\/td>\u6307\u5b9a\u5bc6\u94a5\u957f\u5ea6<\/td><\/tr>
-e<\/td>\u8bfb\u53d6\u5df2\u6709\u79c1\u94a5\u6216\u8005\u516c\u94a5\u6587\u4ef6<\/td><\/tr>
-f<\/td>\u6307\u5b9a\u7528\u6765\u4fdd\u5b58\u5bc6\u94a5\u7684\u6587\u4ef6\u540d<\/td><\/tr>
-t<\/td>\u6307\u5b9a\u8981\u521b\u5efa\u7684\u5bc6\u94a5\u7c7b\u578b<\/td><\/tr>
-C<\/td>\u6dfb\u52a0\u6ce8\u91ca<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u521b\u5efa\u4e00\u4e2aSSH\u5bc6\u94a5\u6587\u4ef6\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# ssh-keygen<\/strong>\nGenerating public\/private rsa key pair.\nEnter file in which to save the key (\/root\/.ssh\/id_rsa): \u76f4\u63a5\u56de\u8f66\uff0c\u4ee5\u9ed8\u8ba4\u8def\u5f84\u4fdd\u5b58<\/strong>\nCreated directory '\/root\/.ssh'.\nEnter passphrase (empty for no passphrase): \u76f4\u63a5\u56de\u8f66\uff0c\u4e0d\u989d\u5916\u8bbe\u7f6e\u5bc6\u94a5<\/strong><\/strong>\u5bc6\u7801<\/strong>\nEnter same passphrase again: \u76f4\u63a5\u56de\u8f66\uff0c\u786e\u8ba4\u4e0d\u989d\u5916\u8bbe\u7f6e\u5bc6\u94a5\u5bc6\u7801<\/strong>\nYour identification has been saved in \/root\/.ssh\/id_rsa.\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\nSHA256:tUB6SjLnvqM7p2l+bmHUZGNqUyyOPmXGyiMp3tC9xNA root@linuxcool.com\nThe key's randomart image is:\n+---[RSA 2048]----+\n|       ..        |\n|      .oB        |\n|    +++Oo..      |\n|   ..E@o.o .     |\n|  .++Bo.S .      |\n|..o.*=o          |\n|..o..+o.         |\n| . .oo=.         |\n|   o*Xo.         |\n+----[SHA256]-----+<\/pre>\n\n\n\n

\u624b\u52a8\u6307\u5b9a\u52a0\u5bc6\u683c\u5f0f\u5e76\u6dfb\u52a0\u6ce8\u91ca\u4fe1\u606f\uff0c\u521b\u5efa\u4e00\u4e2aSSH\u5bc6\u94a5\u6587\u4ef6<\/p>\n\n\n\n

[root@linuxcool ~]# ssh-keygen -t rsa -C \"welcome to linuxcool.com\"<\/strong>\nGenerating public\/private rsa key pair.\nEnter file in which to save the key (\/root\/.ssh\/id_rsa): \u76f4\u63a5\u56de\u8f66\uff0c\u4ee5\u9ed8\u8ba4\u8def\u5f84\u4fdd\u5b58<\/strong>\nCreated directory '\/root\/.ssh'.\nEnter passphrase (empty for no passphrase): \u76f4\u63a5\u56de\u8f66\uff0c\u4e0d\u989d\u5916\u8bbe\u7f6e\u5bc6\u94a5<\/strong>\u5bc6\u7801<\/strong>\nEnter same passphrase again: \u76f4\u63a5\u56de\u8f66\uff0c\u786e\u8ba4\u4e0d\u989d\u5916\u8bbe\u7f6e\u5bc6\u94a5\u5bc6\u7801<\/strong>\nYour identification has been saved in \/root\/.ssh\/id_rsa.\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.\nThe key fingerprint is:\nSHA256:OQodor0B83DoxbFOY+KUo0swrQAgo8tL3qIHA0t40gQ welcome to linuxcool.com\nThe key's randomart image is:\n+---[RSA 2048]----+\n|E.  .            |\n|+o.+ o           |\n|*o@ X .          |\n|BXo\/ + . .       |\n|*B+ * . S        |\n|B.o  + . .       |\n|.* .. .          |\n|. o              |\n|..               |\n+----[SHA256]-----+<\/pre>\n","protected":false},"excerpt":{"rendered":"

ssh-keygen\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cSSH key generate\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u751f\u6210SSH\u5bc6\u94a5\u6587 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3946"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=3946"}],"version-history":[{"count":12,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3946\/revisions"}],"predecessor-version":[{"id":10226,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/3946\/revisions\/10226"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=3946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=3946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=3946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}