{"id":5629,"date":"2024-06-29T00:10:07","date_gmt":"2024-06-28T16:10:07","guid":{"rendered":"https:\/\/www.baishitou.cn\/?p=5629"},"modified":"2024-06-29T00:13:42","modified_gmt":"2024-06-28T16:13:42","slug":"%e5%a6%82%e4%bd%95%e5%9c%a8-vultr-%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%ad%e4%bd%bf%e7%94%a8-ssh","status":"publish","type":"post","link":"https:\/\/www.baishitou.cn\/5629.html","title":{"rendered":"\u5982\u4f55\u5728 Vultr \u670d\u52a1\u5668\u4e2d\u4f7f\u7528 SSH"},"content":{"rendered":"
SSH \u662f\u4e00\u79cd\u534f\u8bae\uff0c\u5141\u8bb8\u60a8\u4ece\u8fdc\u7a0b\u7cfb\u7edf\u8fde\u63a5\u5230\u57fa\u4e8e Linux \u6216 Unix \u7684\u670d\u52a1\u5668\u3002OpenSSH \u662f\u4e00\u79cd\u8fde\u63a5\u5de5\u5177\uff0c\u5b83\u4f7f\u7528 SSH \u534f\u8bae\u901a\u8fc7\u5b89\u5168\u5916\u58f3\u5728\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u3002\u672c\u6307\u5357\u4ecb\u7ecd\u4e86\u5982\u4f55\u4f7f\u7528\u5bc6\u7801\u901a\u8fc7 SSH \u8fde\u63a5\u5230\u60a8\u7684 Vultr \u670d\u52a1\u5668\u6216\u4f7f\u7528 OpenSSH \u7684 SSH \u5bc6\u94a5\u3002\u5b83\u8fd8\u4ecb\u7ecd\u4e86\u5982\u4f55\u751f\u6210 SSH \u5bc6\u94a5\u5e76\u5c06\u5176\u624b\u52a8\u6dfb\u52a0\u5230\u670d\u52a1\u5668\u3002<\/p>\n \u82e5\u8981\u4f7f\u7528 SSH \u5ba2\u6237\u7aef\u548c\u5bc6\u7801\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u8bf7\u5728\u672c\u5730\u5de5\u4f5c\u7ad9\u4e0a\u6253\u5f00\u547d\u4ee4\u63d0\u793a\u7b26\u5e76\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u3002\u5c06\u793a\u4f8b IP \u5730\u5740\u66ff\u6362\u4e3a\u670d\u52a1\u5668\u7684 IP \u5730\u5740\uff0c\u60a8\u53ef\u4ee5\u5728 Vultr \u5ba2\u6237\u95e8\u6237\u7684\u670d\u52a1\u5668\u4fe1\u606f\u9875\u9762\u4e0a\u627e\u5230\u8be5\u5730\u5740\u3002<\/p>\n SSH \u663e\u793a\u4e00\u6761\u8b66\u544a\u4ee5\u786e\u8ba4\u670d\u52a1\u5668\u7684\u771f\u5b9e\u6027\u3002\u952e\u5165\u5e76\u6309 \u3002\u60a8\u5c06\u770b\u5230\u5bc6\u7801\u63d0\u793a\u3002\u952e\u5165\u5bc6\u7801\uff0c\u7136\u540e\u6309 \u3002 \u6ce8\u610f\uff1a<\/strong>\u952e\u5165\u65f6\u5bc6\u7801\u5c06\u4e0d\u53ef\u89c1\u3002<\/p>\n \u73b0\u5728\uff0c\u60a8\u5c06\u767b\u5f55\u5230\u670d\u52a1\u5668\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u547d\u4ee4\u4e0e\u670d\u52a1\u5668\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n SSH \u5bc6\u94a5\u5bf9\u5305\u542b\u516c\u94a5\u548c\u79c1\u94a5\u3002\u516c\u94a5\u5b58\u50a8\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u79c1\u94a5\u5b58\u50a8\u5728\u5c06\u7528\u4e8e\u8fde\u63a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u3002\u8fd9\u4e24\u4e2a\u5bc6\u94a5\u5bf9\u4e8e\u4f7f\u7528 SSH \u5bc6\u94a5\u901a\u8fc7 SSH \u8fde\u63a5\u5230\u670d\u52a1\u5668\u90fd\u662f\u5fc5\u9700\u7684\u3002<\/p>\n \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728 Windows\u3001Linux \u548c Mac \u4e2d\u751f\u6210\u5bc6\u94a5\u5bf9\u3002<\/p>\n \u54ea\u91cc<\/p>\n \u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210 SSH \u5bc6\u94a5\u5bf9\u3002<\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u8f93\u5165\u751f\u6210\u5bc6\u94a5\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u503c\u5728\u62ec\u53f7\u4e2d\u663e\u793a\u4e3a\u00a0\uff08C\uff1a\\Users\\Username\/.ssh\/id_ed25519\uff09\u3002<\/em><\/p>\n \u6ce8\u610f\uff1a\u5efa\u8bae\u4f7f\u7528\u6b64\u76ee\u5f55\u3002\u56e0\u4e3a\u5728\u767b\u5f55\u65f6\uff0cSSH\u4f1a\u5728\u9ed8\u8ba4\u76ee\u5f55\u4e2d\u67e5\u627e\u5bc6\u94a5\u3002\u5982\u679c\u4f7f\u7528\u9ed8\u8ba4\u76ee\u5f55\u4ee5\u5916\u7684\u76ee\u5f55\uff0c\u5219\u9700\u8981\u663e\u5f0f\u6307\u5b9a\u952e\u4f4d\u7f6e\u3002<\/p><\/blockquote>\n \u6309\u4e0b\u53ef\u4f7f\u7528\u9ed8\u8ba4\u4f4d\u7f6e\u3002ENTER<\/kbd><\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165\u5bc6\u94a5\u7684\u5bc6\u7801\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u4e5f\u53ef\u4ee5\u6309\u4e0b\u521b\u5efa\u6ca1\u6709\u5bc6\u7801\u7684\u952e\u3002\u5982\u679c\u60a8\u9009\u62e9\u8f93\u5165\u5bc6\u7801\uff0c\u5219\u6bcf\u6b21\u4f7f\u7528\u6b64\u5bc6\u94a5\u767b\u5f55\u65f6\u90fd\u9700\u8981\u4f7f\u7528\u5b83\u3002ENTER<\/kbd><\/p>\n \u786e\u8ba4\u5bc6\u7801\u540e\uff0c\u5c06\u751f\u6210\u5bc6\u94a5\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5e76\u663e\u793a\u4ee5\u4e0b\u6d88\u606f\u3002<\/p>\n \u542f\u52a8 Linux shell \u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa SSH \u5bc6\u94a5\u5bf9\u3002<\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u8f93\u5165\u5bc6\u94a5\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u503c\u5728\u62ec\u53f7\u4e2d\u663e\u793a\u4e3a\u00a0\uff08\/home\/username\/.ssh\/id_ed25519\uff09<\/em><\/p>\n \u6ce8\u610f\uff1a\u5efa\u8bae\u4f7f\u7528\u6b64\u76ee\u5f55\u3002\u56e0\u4e3a\u5728\u767b\u5f55\u65f6\uff0cSSH\u4f1a\u5728\u9ed8\u8ba4\u76ee\u5f55\u4e2d\u67e5\u627e\u5bc6\u94a5\u3002\u5982\u679c\u4f7f\u7528\u9ed8\u8ba4\u76ee\u5f55\u4ee5\u5916\u7684\u76ee\u5f55\uff0c\u5219\u9700\u8981\u663e\u5f0f\u6307\u5b9a\u952e\u4f4d\u7f6e\u3002<\/p><\/blockquote>\n \u6309\u4e0b\u53ef\u4f7f\u7528\u9ed8\u8ba4\u4f4d\u7f6e\u3002ENTER<\/kbd><\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165\u5bc6\u94a5\u7684\u5bc6\u7801\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u4e5f\u53ef\u4ee5\u6309\u4e0b\u521b\u5efa\u6ca1\u6709\u5bc6\u7801\u7684\u952e\u3002\u5982\u679c\u60a8\u9009\u62e9\u8f93\u5165\u5bc6\u7801\uff0c\u5219\u6bcf\u6b21\u4f7f\u7528\u6b64\u5bc6\u94a5\u767b\u5f55\u65f6\u90fd\u9700\u8981\u4f7f\u7528\u5b83\u3002ENTER<\/kbd><\/p>\n \u786e\u8ba4\u5bc6\u7801\u540e\uff0c\u5c06\u751f\u6210\u5bc6\u94a5\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5e76\u663e\u793a\u4ee5\u4e0b\u6d88\u606f\u3002<\/p>\n \u542f\u52a8\u7ec8\u7aef\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u751f\u6210 SSH \u5bc6\u94a5\u5bf9\u3002<\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u60a8\u8f93\u5165\u751f\u6210\u5bc6\u94a5\u7684\u4f4d\u7f6e\u3002\u9ed8\u8ba4\u503c\u5728\u62ec\u53f7\u4e2d\u663e\u793a\u4e3a\u00a0\uff08\/Users\/Username\/.ssh\/id_ed25519\uff09\u3002<\/em><\/p>\n \u6ce8\u610f\uff1a\u5efa\u8bae\u4f7f\u7528\u6b64\u76ee\u5f55\u3002\u56e0\u4e3a\u5728\u767b\u5f55\u65f6\uff0cSSH\u4f1a\u5728\u9ed8\u8ba4\u76ee\u5f55\u4e2d\u67e5\u627e\u5bc6\u94a5\u3002\u5982\u679c\u4f7f\u7528\u9ed8\u8ba4\u76ee\u5f55\u4ee5\u5916\u7684\u76ee\u5f55\uff0c\u5219\u9700\u8981\u663e\u5f0f\u6307\u5b9a\u952e\u4f4d\u7f6e\u3002<\/p><\/blockquote>\n \u6309\u4e0b\u53ef\u4f7f\u7528\u9ed8\u8ba4\u4f4d\u7f6e\u3002ENTER<\/kbd><\/p>\n \u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165\u5bc6\u94a5\u7684\u5bc6\u7801\u3002\u60a8\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8f93\u5165\u5bc6\u7801\uff0c\u4e5f\u53ef\u4ee5\u6309\u4e0b\u521b\u5efa\u6ca1\u6709\u5bc6\u7801\u7684\u952e\u3002\u5982\u679c\u60a8\u9009\u62e9\u8f93\u5165\u5bc6\u7801\uff0c\u5219\u6bcf\u6b21\u4f7f\u7528\u6b64\u5bc6\u94a5\u767b\u5f55\u65f6\u90fd\u9700\u8981\u4f7f\u7528\u5b83\u3002ENTER<\/kbd><\/p>\n \u786e\u8ba4\u5bc6\u7801\u540e\uff0c\u5c06\u751f\u6210\u5bc6\u94a5\u5e76\u5c06\u5176\u5b58\u50a8\u5728\u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u5e76\u663e\u793a\u4ee5\u4e0b\u6d88\u606f\u3002<\/p>\n SCP \u547d\u4ee4\u7528\u4e8e\u5c06\u6587\u4ef6\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u5fc5\u987b\u5c06\u516c\u6709 SSH \u5bc6\u94a5\u590d\u5236\u5230\u670d\u52a1\u5668\u624d\u80fd\u542f\u7528 SSH \u8eab\u4efd\u9a8c\u8bc1\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u8be5\u547d\u4ee4\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002 \u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\u6216 Linux shell\uff0c\u7136\u540e\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u4ee5\u590d\u5236\u516c\u94a5\u3002<\/p>\n \u54ea\u91cc<\/p>\n \u6587\u4ef6\u5c06\u590d\u5236\u5230\u76ee\u5f55\u4e2d\u3002\u73b0\u5728\uff0c\u60a8\u9700\u8981\u5c06\u5bc6\u94a5\u590d\u5236\u5230\u6587\u4ef6\u4e2d\u5e76\u542f\u7528 SSH \u8eab\u4efd\u9a8c\u8bc1\u3002\u767b\u5f55\u5230\u65b0\u521b\u5efa\u7684 Vultr \u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u822a\u5230\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u3002 \u5982\u679c\u76ee\u5f55\u5c1a\u4e0d\u5b58\u5728\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\u3002 \u5bfc\u822a\u5230 .ssh \u6587\u4ef6\u5939\u3002<\/p>\n \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u5c06\u516c\u94a5\u5b58\u50a8\u5728\u670d\u52a1\u5668\u4e2d\u7684\u5bc6\u94a5\u3002 \u4ec5\u5f53\u6587\u4ef6\u4e0d\u5b58\u5728\u65f6\uff0c\u8be5\u547d\u4ee4\u624d\u4f1a\u521b\u5efa\u6587\u4ef6\u3002 \u521b\u5efa\u6587\u4ef6\u540e\uff0c\u4f7f\u7528\u5982\u4e0b\u6240\u793a\u7684\u547d\u4ee4\u5c06\u516c\u94a5\u7684\u5185\u5bb9\u590d\u5236\u5230\u6587\u4ef6\u4e2d\u3002 \u94a5\u5319\u653e\u7f6e\u5728\u9002\u5f53\u7684\u4f4d\u7f6e\u3002<\/p>\n SSH \u8eab\u4efd\u9a8c\u8bc1\u65b9\u6cd5\u5728\u540d\u4e3a \u8981\u4f7f\u7528 SSH \u5bc6\u94a5\u542f\u7528\u8eab\u4efd\u9a8c\u8bc1\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bfc\u822a\u5230\u8be5\u76ee\u5f55\u3002 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6253\u5f00\u6587\u4ef6\u3002 \u5728\u6587\u4ef6\u4e2d\uff0c\u67e5\u627e\u5e76\u53d6\u6d88\u6ce8\u91ca\u4ee5\u4e0b\u4e24\u884c\u3002<\/p>\n \u5c06\u53c2\u6570\u8bbe\u7f6e\u4e3a\u542f\u7528\u4f7f\u7528\u516c\u94a5\u7684\u8eab\u4efd\u9a8c\u8bc1\u3002\u8be5\u53c2\u6570\u6307\u5b9a\u516c\u94a5\u7684\u4f4d\u7f6e\u3002\u73b0\u5728\uff0c\u5bc6\u94a5\u5df2\u6dfb\u52a0\u5230\u73b0\u6709\u670d\u52a1\u5668\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528\u4e0b\u4e00\u8282\u4e2d\u5b9a\u4e49\u7684\u6b65\u9aa4\u4f7f\u7528\u516c\u94a5\u901a\u8fc7 SSH \u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002 OpenSSH \u5ba2\u6237\u7aef\u63d0\u4f9b\u4e0e\u670d\u52a1\u5668\u5efa\u7acb SSH \u8fde\u63a5\u7684\u547d\u4ee4\u3002\u542f\u52a8\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u7136\u540e\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u4f7f\u7528 SSH \u5bc6\u94a5\u901a\u8fc7 SSH \u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002 \u54ea\u91cc<\/p>\n \u6b64\u547d\u4ee4\u5c06\u4f7f\u7528\u672c\u5730\u8ba1\u7b97\u673a\u7684\u9ed8\u8ba4 ssh \u76ee\u5f55 \uff08\uff09 \u4e2d\u7684\u79c1\u94a5\u3002\u5982\u679c\u516c\u94a5\u548c\u79c1\u94a5\u6b63\u786e\u5339\u914d\uff0c\u5219\u5c06\u5efa\u7acbSSH\u8fde\u63a5\uff0c\u5e76\u4e14\u60a8\u53ef\u4ee5\u4e0e\u670d\u52a1\u5668\u901a\u4fe1\u3002 \u8981\u4f7f\u7528 SSH \u5bc6\u94a5\u90e8\u7f72\u65b0\u670d\u52a1\u5668\uff0c\u60a8\u9700\u8981\u5728 Vultr Dashboard \u4e2d\u521b\u5efa SSH \u5bc6\u94a5\u3002\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u5c06 SSH \u5bc6\u94a5\u6dfb\u52a0\u5230\u60a8\u7684 Vultr \u5e10\u6237\u3002<\/p>\n \u5c06\u6dfb\u52a0 SSH \u5bc6\u94a5\uff0c\u60a8\u53ef\u4ee5\u5728\u542f\u52a8\u65b0\u670d\u52a1\u5668\u65f6\u5728 SSH \u5bc6\u94a5\u90e8\u5206\u4e2d\u9009\u62e9\u6b64 SSH \u5bc6\u94a5\u3002<\/p>\n \u4f7f\u7528SSH\u5bc6\u94a5\u8fde\u63a5\u5230VULTR\u4e91\u670d\u52a1\u5668<\/a><\/p>\n<\/a><\/p>\n
\u4ecb\u7ecd<\/h2>\n
\u5982\u4f55\u4f7f\u7528\u5bc6\u7801\u8fde\u63a5<\/h2>\n
$ ssh root@192.0.2.123<\/code><\/pre>\n
Yes<\/code>ENTER<\/kbd>ENTER<\/kbd><\/p>\n
\u4ec0\u4e48\u662f SSH \u5bc6\u94a5\u5bf9<\/h2>\n
\u5982\u4f55\u5728 Windows\u3001Linux\u3001Mac \u4e0a\u751f\u6210\u5bc6\u94a5<\/h2>\n
ssh-keygen<\/code>\u5b9e\u7528\u7a0b\u5e8f\u53ef\u7528\u4e8e\u751f\u6210 SSH \u5bc6\u94a5\u3002<\/p>\n
\u5982\u4f55\u4f7f\u7528\u547d\u4ee4
ssh-keygen<\/code><\/h3>\n
ssh-keygen -t ed25519 -C email@example.com<\/code><\/pre>\n
\n
ssh-keygen<\/code>- \u751f\u6210SSH\u5bc6\u94a5\u5bf9\u7684\u547d\u4ee4<\/li>\n
-t<\/code>- \u7528\u4e8e\u6307\u5b9a\u5bc6\u94a5\u7c7b\u578b\u7684\u6807\u5fd7<\/li>\n
ed25519<\/code>- \u8981\u751f\u6210\u7684\u5bc6\u94a5\u7684\u7c7b\u578b\u3002 \u5efa\u8bae\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u6bd4 RSA \u7c7b\u578b\u5bc6\u94a5\u66f4\u5b89\u5168
ed25519<\/code><\/li>\n
-C<\/code>- \u6807\u5fd7\u4ee5\u6307\u5b9a\u952e\u7684\u6ce8\u91ca<\/li>\n
email<\/code>- \u8981\u5728\u5bc6\u94a5\u4e2d\u6dfb\u52a0\u7684\u6ce8\u91ca\u3002\u6b64\u6ce8\u91ca\u5c06\u9644\u52a0\u5728\u516c\u94a5\u5b57\u7b26\u4e32\u7684\u672b\u5c3e\u3002\u5f53\u670d\u52a1\u5668\u4e0a\u6709\u66f4\u591a\u516c\u94a5\u53ef\u7528\u65f6\uff0c\u5b83\u5c06\u6709\u52a9\u4e8e\u8bc6\u522b\u5bc6\u94a5\uff08\u7a0d\u540e\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u672c\u4e3b\u9898\uff09\u3002<\/li>\n<\/ul>\n
\u5728 Windows \u4e0a\u751f\u6210\u5bc6\u94a5<\/h3>\n
C:\\users\\username> ssh-keygen -t ed25519 -C email@example.com<\/code><\/pre>\n
Generating public\/private ed25519 key pair.\r\nEnter file in which to save the key (C:\\Users\\username\/.ssh\/id_ed25519):<\/code><\/pre>\n
Enter passphrase (empty for no passphrase):<\/code><\/pre>\n
Your identification has been saved in C:\\Users\\username\/.ssh\/id_ed25519.\r\nYour public key has been saved in C:\\Users\\username\/.ssh\/id_ed25519.pub.\r\nThe key fingerprint is:\r\nSHA256:W6ceE1mGIi87YjD9BEUoROg3Aie\/fOZMr1c+qOSD8Wk email@example.com\r\nThe key's randomart image is:\r\n+--[ED25519 256]--+\r\n| +o oo |\r\n+----[SHA256]-----+<\/code><\/pre>\n
\u5728 Linux \u4e0a\u751f\u6210\u5bc6\u94a5<\/h3>\n
$ ssh-keygen -t ed25519 -C email@example.com<\/code><\/pre>\n
Generating public\/private ed25519 key pair.\r\nEnter file in which to save the key (C:\\Users\\username\/.ssh\/id_ed25519):<\/code><\/pre>\n
Enter passphrase (empty for no passphrase):<\/code><\/pre>\n
Your identification has been saved in \/home\/ubuntu\/.ssh\/id_ed25519\r\nYour public key has been saved in \/home\/ubuntu\/.ssh\/id_ed25519.pub\r\n\r\nThe key fingerprint is:\r\nSHA256:c0hYyBV+e1vY7DUVage\/3nYk4z9DvxzrLmsiek7dkZE email@example.com\r\nThe key's randomart image is:\r\n+--[ED25519 256]--+\r\n| . o+. . . |\r\n+----[SHA256]-----+\r\n| o+ = .|<\/code><\/pre>\n
\u5728Mac\u4e0a\u751f\u6210\u5bc6\u94a5<\/h3>\n
% ssh-keygen -t ed25519 -C email@example.com<\/code><\/pre>\n
Generating public\/private ed25519 key pair.\r\nEnter file in which to save the key (\/Users\/Username\/.ssh\/id_ed25519):<\/code><\/pre>\n
Enter passphrase (empty for no passphrase):<\/code><\/pre>\n
Your identification has been saved in \/Users\/Username\/.ssh\/id_ed25519.\r\nYour public key has been saved in \/Users\/Username\/.ssh\/id_ed25519.pub.\r\nThe key fingerprint is:\r\nSHA256:W6ceE1mGIi87YjD9BEUoROg3Aie\/fOZMr1c+qOSD8Wk email@example.com\r\nThe key's randomart image is:\r\n+--[ED25519 256]--+\r\n| +o oo |\r\n+----[SHA256]-----+<\/code><\/pre>\n
\u5982\u4f55\u5411\u73b0\u6709\u670d\u52a1\u5668\u6dfb\u52a0\u5bc6\u94a5<\/h2>\n
scp<\/code><\/p>\n
C:\\users\\username> scp C:\\Users\\username\\.ssh\\id_ed25519.pub example_user@192.0.2.123:\/home\/example_user <\/code><\/pre>\n
\n
SCP<\/code>- \u590d\u5236\u6587\u4ef6\u7684\u547d\u4ee4<\/li>\n
C:\\Users\\username\\.ssh\\id_ed25519.pub<\/code>- \u751f\u6210\u7684\u516c\u94a5\u4f4d\u7f6e<\/li>\n
example_user<\/code>- \u9700\u8981\u5c06\u6587\u4ef6\u590d\u5236\u5230\u7684\u670d\u52a1\u5668\u7684\u7528\u6237\u540d\u3002\u60a8\u9700\u8981\u6709\u6743\u8bbf\u95ee\u6b64\u670d\u52a1\u5668<\/li>\n
192.0.2.123<\/code>- \u670d\u52a1\u5668\u7684IP\u5730\u5740<\/li>\n
\/home\/example_user<\/code>- \u670d\u52a1\u5668\u4e0a\u7684\u76ee\u6807\u6587\u4ef6\u5939\u4f4d\u7f6e<\/li>\n<\/ul>\n
authorized_keys<\/code><\/p>\n
$ cd \/home\/example_user\/ <\/code><\/pre>\n
.ssh<\/code><\/p>\n
$ mkdir .ssh<\/code><\/pre>\n
$ cd .ssh<\/code><\/pre>\n
authorized_keys<\/code><\/p>\n
$ touch authorized_keys<\/code><\/pre>\n
touch<\/code><\/p>\n
authorized_keys<\/code>
cat<\/code><\/p>\n
$ cat \/home\/example_user\/id_ed25519.pub >> authorized_keys<\/code><\/pre>\n
\u542f\u7528 SSH \u5bc6\u94a5\u8eab\u4efd\u9a8c\u8bc1<\/h3>\n
sshd_config.<\/code><\/p>\n
\/etc\/ssh\/<\/code><\/p>\n
$ cd \/etc\/ssh <\/code><\/pre>\n
sshd_config<\/code><\/p>\n
$ sudo nano sshd_config<\/code><\/pre>\n
PubkeyAuthentication yes\r\nAuthorizedKeysFile .ssh\/authorized_keys .ssh\/authorized_keys2<\/code><\/pre>\n
PubkeyAuthentication<\/code>
yes<\/code>
AuthorizedKeysFile<\/code><\/p>\n
\u5982\u4f55\u4f7f\u7528\u5bc6\u94a5\u8fde\u63a5<\/h2>\n
ssh<\/code><\/p>\n
C:\\users\\username> ssh example_user@192.0.2.123<\/code><\/pre>\n
\n
ssh<\/code>- \u5efa\u7acb\u8fde\u63a5\u7684\u547d\u4ee4<\/li>\n
example_user<\/code>- \u7528\u4e8e\u5efa\u7acb\u8fde\u63a5\u7684\u7528\u6237\u540d<\/li>\n
192.0.2.123<\/code>- \u670d\u52a1\u5668\u7684IP\u5730\u5740<\/li>\n<\/ul>\n
.\/users\/.ssh<\/code><\/p>\n
\u5982\u4f55\u4f7f\u7528\u5bc6\u94a5\u90e8\u7f72\u65b0\u670d\u52a1\u5668<\/h2>\n
\n
<\/li>\n
\u76f8\u5173\u6587\u7ae0<\/h2>\n