{"id":8,"date":"2025-08-25T23:54:02","date_gmt":"2025-08-25T15:54:02","guid":{"rendered":"https:\/\/wuhanshanghai.com\/?p=8"},"modified":"2025-08-25T23:55:22","modified_gmt":"2025-08-25T15:55:22","slug":"1of100","status":"publish","type":"post","link":"https:\/\/wuhanshanghai.com\/index.php\/2025\/08\/25\/1of100\/","title":{"rendered":"\u8fde\u66f4 100 \u592901- IT\u77e5\u8bc6 &#8211; Mac \u5982\u4f55\u8bbe\u7f6e\u5bc6\u94a5\u8bbf\u95ee Ubuntu\u4e91\u670d\u52a1\u5668-20250825"},"content":{"rendered":"<section id=\"wenyan\" class=\"preview\">\n<ol>\n<li>\u767b\u5f55Ubuntu \u4e91\u670d\u52a1\u5668<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">ssh-keygen  &lt;== \u5efa\u7acb\u5bc6\u94a5\u5bf9\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/root\/.ssh\/id_rsa): &lt;== \u6309 Enter\r\nCreated directory '\/root\/.ssh'.\r\nEnter passphrase (empty for no passphrase): &lt;== \u8f93\u5165\u5bc6\u94a5\u9501\u7801\uff0c\u6216\u76f4\u63a5\u6309 Enter \u7559\u7a7a\r\nEnter same passphrase again: &lt;== \u518d\u8f93\u5165\u4e00\u904d\u5bc6\u94a5\u9501\u7801\r\nYour identification has been saved in \/root\/.ssh\/id_rsa. &lt;== \u79c1\u94a5\r\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub. &lt;== \u516c\u94a5\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li>\u5728\u670d\u52a1\u5668\u4e0a\u5b89\u88c5\u516c\u94a5<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">    cd ~\/.ssh\r\n    cat &lt;\u516c\u94a5\u540d\u5b57&gt; &gt;&gt; authorized_keys\r\n    chmod 600 authorized_keys\r\n    chmod 700 ~\/.ssh\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li>\u6253\u5f00 ssh \u7684\u5bc6\u94a5\u767b\u5f55\u529f\u80fd<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">sudo vim \/etc\/ssh\/sshd_config\r\n#\u5728\u672b\u5c3e\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9\r\nRSAAuthentication yes\r\nPubkeyAuthentication yes\r\nPasswordAuthentication no #\u7981\u7528\u5bc6\u94a5\u767b\u5f55\uff0c\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u9009\u62e9\u662f\u5426\u9700\u8981\u6dfb\u52a0\r\n<\/code><\/pre>\n<ol start=\"4\">\n<li>\u91cd\u542f ssh \u670d\u52a1<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">service sshd restart\r\n<\/code><\/pre>\n<ol start=\"5\">\n<li>\u5c06\u79c1\u94a5\u4e0b\u8f7d\u5230Mac \u672c\u5730\u8fdb\u884c\u914d\u7f6e<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">vim ~\/.ssh\/config #\u5982\u679c\u6ca1\u6709\uff0c\u4f7f\u7528 mkdir ~\/.ssh\/ touch ~\/.ssh\/config\u521b\u5efa\u4e00\u4e2a\r\n#\u4ee5\u4e0b\u662f\u9700\u8981\u914d\u7f6e\u7684\u5185\u5bb9\r\nHost example-server            #Host\u53ef\u4ee5\u81ea\u5b9a\u4e49\uff0c\u8fd9\u4e2a\u662f\u4f60\u670d\u52a1\u5668\u7684\u522b\u540d\r\n    HostName exampleserverIP   #\u4f60\u9700\u8981\u767b\u5f55\u7684\u670d\u52a1\u5668IP\r\n    User examplename           #\u4f60\u7684\u5bc6\u94a5\u5bf9\u5e94\u7684\u7528\u6237 \r\n    IdentityFile yourkeypath   #\u4f60\u7684\u79c1\u94a5\u8def\u5f84\uff0c\u6700\u597d\u4e5f\u653e\u5230~\/.ssh\u4e0b\u9762\u6765\r\n<\/code><\/pre>\n<ol start=\"6\">\n<li>\u8fde\u63a5\u670d\u52a1\u5668<\/li>\n<\/ol>\n<pre data-code-block-lang=\"bash\" data-code-block-mode=\"2\"><code class=\"hljs language-bash\">ssh example-server\r\n<\/code><\/pre>\n<\/section>\n","protected":false},"excerpt":{"rendered":"<p>\u767b\u5f55Ubuntu \u4e91\u670d\u52a1\u5668 ssh-keygen &lt;== \u5efa\u7acb\u5bc6\u94a5\u5bf9 Generating public [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":1,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"predecessor-version":[{"id":9,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/posts\/8\/revisions\/9"}],"wp:attachment":[{"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wuhanshanghai.com\/index.php\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}