{"id":30965,"date":"2025-04-21T06:50:57","date_gmt":"2025-04-20T22:50:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/30965.html"},"modified":"2025-04-21T06:50:57","modified_gmt":"2025-04-20T22:50:57","slug":"linux%e5%92%8cwindows%e9%85%8d%e7%bd%ae%e5%85%ac%e9%92%a5%e5%88%b0%e6%9c%8d%e5%8a%a1%e5%99%a8%e4%b8%8a%e3%80%90%e5%85%8d%e5%af%86%e7%99%bb%e5%bd%95-%e4%bc%a0%e8%be%93%e6%96%87%e4%bb%b6%e3%80%91","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/30965.html","title":{"rendered":"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011"},"content":{"rendered":"<\/p>\n<h4>\u6587\u7ae0\u76ee\u5f55<\/h4>\n<ul>\n<li>1.Windows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a<\/li>\n<li>\n<ul>\n<li>1.1.\u751f\u6210SSH\u5bc6\u94a5\u5bf9&#xff08;\u5982\u679c\u5c1a\u672a\u751f\u6210&#xff09;&#xff1a;<\/li>\n<li>1.2.\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/li>\n<li>1.3.\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/li>\n<li>1.4.\u6d4b\u8bd5SSH\u8fde\u63a5&#xff1a;<\/li>\n<\/ul>\n<\/li>\n<li>2.Linux\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a<\/li>\n<li>\n<ul>\n<li>2.1\u751f\u6210SSH\u5bc6\u94a5\u5bf9&#xff08;\u5982\u679c\u8fd8\u6ca1\u6709\u7684\u8bdd&#xff09;<\/li>\n<li>2.2.\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/li>\n<li>\n<ul>\n<li>1. \u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u547d\u4ee4\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/li>\n<li>2. \u624b\u52a8\u590d\u5236\u516c\u94a5&#xff08;\u5982\u679c\u6ca1\u6709 ssh-copy-id&#xff09;<\/li>\n<li>3.\u6d4b\u8bd5\u8fde\u63a5&#xff1a;<\/li>\n<li>4.\u53ef\u80fd\u51fa\u73b0\u8b66\u544a<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>1.Windows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a<\/h2>\n<p>\u5982\u679c\u4f60\u5728\u672c\u5730\u4f7f\u7528\u7684\u662f Windows &#xff0c;\u8981\u5c06\u672c\u5730\u751f\u6210\u7684 SSH \u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a&#xff0c;\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u64cd\u4f5c&#xff1a;<\/p>\n<h3>1.1.\u751f\u6210SSH\u5bc6\u94a5\u5bf9&#xff08;\u5982\u679c\u5c1a\u672a\u751f\u6210&#xff09;&#xff1a;<\/h3>\n<p>\u5728 Windows 11 \u4e0a&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 Git Bash \u6216\u8005 Windows Terminal \u6765\u751f\u6210 SSH \u5bc6\u94a5\u5bf9\u3002<\/p>\n<ul>\n<li>\n<p>\u6253\u5f00 Git Bash \u6216\u8005 Windows Terminal\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u6765\u751f\u6210 SSH \u5bc6\u94a5\u5bf9&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p>ssh-keygen <span class=\"token parameter variable\">-t<\/span> rsa <span class=\"token parameter variable\">-b<\/span> <span class=\"token number\">4096<\/span> <span class=\"token parameter variable\">-C<\/span> <span class=\"token string\">&#034;your_email&#064;example.com&#034;<\/span><\/p>\n<p>\u6309\u7167\u63d0\u793a\u64cd\u4f5c&#xff0c;\u9009\u62e9\u5bc6\u94a5\u6587\u4ef6\u5b58\u50a8\u4f4d\u7f6e&#xff0c;\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5c06\u4f1a\u5b58\u50a8\u5728 C:\\\\Users\\\\YourUsername\\\\.ssh\\\\id_rsa \u548c C:\\\\Users\\\\YourUsername\\\\.ssh\\\\id_rsa.pub\u3002<\/p>\n<h3>1.2.\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/h3>\n<p>\u5728 Windows \u4e0a&#xff0c;\u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u6765\u7b80\u5316\u590d\u5236\u516c\u94a5\u7684\u8fc7\u7a0b&#xff0c;\u4f46\u901a\u5e38\u5b83\u5e76\u4e0d\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u3002\u56e0\u6b64&#xff0c;\u4f60\u53ef\u4ee5\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<ul>\n<li>\n<p>\u6253\u5f00\u4f60\u7684 SSH \u516c\u94a5\u6587\u4ef6 id_rsa.pub\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u6587\u672c\u7f16\u8f91\u5668&#xff08;\u5982 Notepad&#043;&#043;&#xff09;\u6253\u5f00\u8be5\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>\u590d\u5236\u516c\u94a5\u7684\u5185\u5bb9\u3002<\/p>\n<\/li>\n<\/ul>\n<h3>1.3.\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/h3>\n<ul>\n<li>\n<p>\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 SSH \u5ba2\u6237\u7aef&#xff08;\u5982 PuTTY&#xff09;\u8fde\u63a5\u5230\u670d\u52a1\u5668\u3002<\/p>\n<\/li>\n<li>\n<p>\u521b\u5efa SSH \u76ee\u5f55&#xff08;\u5982\u679c\u4e0d\u5b58\u5728&#xff09;&#xff0c;\u5e76\u8bbe\u7f6e\u6743\u9650&#xff1a;<\/p>\n<\/li>\n<\/ul>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> ~\/.ssh<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">700<\/span> ~\/.ssh<\/p>\n<ul>\n<li>\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u6253\u5f00 authorized_keys \u6587\u4ef6&#xff0c;\u5e76\u5c06\u672c\u5730\u516c\u94a5\u7684\u5185\u5bb9\u7c98\u8d34\u5230\u6587\u4ef6\u7684\u672b\u5c3e\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528 nano \u6216\u8005 vim \u7b49\u7f16\u8f91\u5668\u6765\u8fdb\u884c\u7f16\u8f91&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token function\">nano<\/span> ~\/.ssh\/authorized_keys<br \/>\n<span class=\"token function\">vim<\/span> ~\/.ssh\/authorized_keys<\/p>\n<p>\u7136\u540e\u7c98\u8d34\u672c\u5730\u516c\u94a5\u7684\u5185\u5bb9\u5e76\u4fdd\u5b58\u6587\u4ef6\u3002<\/p>\n<ul>\n<li>\u8bbe\u7f6e authorized_keys \u6587\u4ef6\u7684\u6743\u9650&#xff1a;<\/li>\n<\/ul>\n<p><span class=\"token function\">chmod<\/span> <span class=\"token number\">600<\/span> ~\/.ssh\/authorized_keys<\/p>\n<h3>1.4.\u6d4b\u8bd5SSH\u8fde\u63a5&#xff1a;<\/h3>\n<p>\u5173\u95ed\u5f53\u524d\u7684 SSH \u8fde\u63a5\u4f1a\u8bdd&#xff0c;\u7136\u540e\u5c1d\u8bd5\u4f7f\u7528 SSH \u5bc6\u94a5\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/p>\n<p><span class=\"token function\">ssh<\/span> username&#064;server_ip<\/p>\n<p>\u5982\u679c\u6210\u529f\u8fde\u63a5\u5230\u670d\u52a1\u5668\u800c\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801&#xff0c;\u5219\u8bf4\u660e\u516c\u94a5\u590d\u5236\u6210\u529f\u3002 \u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4&#xff0c;\u4f60\u5e94\u8be5\u80fd\u591f\u5728 Windows\u4e0a\u5c06\u672c\u5730\u751f\u6210\u7684 SSH \u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff0c;\u5e76\u4f7f\u7528 SSH \u5bc6\u94a5\u8fdb\u884c\u65e0\u5bc6\u7801\u767b\u5f55\u3002<\/p>\n<h2>2.Linux\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a<\/h2>\n<h3>2.1\u751f\u6210SSH\u5bc6\u94a5\u5bf9&#xff08;\u5982\u679c\u8fd8\u6ca1\u6709\u7684\u8bdd&#xff09;<\/h3>\n<p>ssh-keygen <span class=\"token parameter variable\">-t<\/span> rsa <span class=\"token parameter variable\">-b<\/span> <span class=\"token number\">4096<\/span> <span class=\"token parameter variable\">-C<\/span> <span class=\"token string\">&#034;your_email&#064;example.com&#034;<\/span><\/p>\n<p>\u6309\u63d0\u793a\u64cd\u4f5c&#xff0c;\u901a\u5e38\u4f1a\u5c06\u5bc6\u94a5\u5bf9\u5b58\u50a8\u5728 ~\/.ssh\/id_rsa \u548c ~\/.ssh\/id_rsa.pub\u3002<\/p>\n<h3>2.2.\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;<\/h3>\n<h4>1. \u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u547d\u4ee4\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/h4>\n<p>\u5047\u8bbe\u4f60\u7684\u7528\u6237\u540d\u662f username&#xff0c;\u670d\u52a1\u5668\u5730\u5740\u662f server_ip&#xff1a;<\/p>\n<p>ssh-copy-id username&#064;server_ip<\/p>\n<p>\u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u5bc6\u7801\u3002\u8f93\u5165\u5bc6\u7801\u540e&#xff0c;ssh-copy-id \u4f1a\u81ea\u52a8\u5c06\u4f60\u7684\u516c\u94a5\u8ffd\u52a0\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684 ~\/.ssh\/authorized_keys \u6587\u4ef6\u4e2d\u3002<\/p>\n<h4>2. \u624b\u52a8\u590d\u5236\u516c\u94a5&#xff08;\u5982\u679c\u6ca1\u6709 ssh-copy-id&#xff09;<\/h4>\n<p>\u5982\u679c\u4f60\u7684\u7cfb\u7edf\u6ca1\u6709 ssh-copy-id \u547d\u4ee4&#xff0c;\u4f60\u53ef\u4ee5\u624b\u52a8\u5c06\u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<li>\u5148\u67e5\u770b\u4f60\u7684\u516c\u94a5\u5185\u5bb9&#xff1a;\u590d\u5236\u663e\u793a\u51fa\u6765\u7684\u516c\u94a5\u5185\u5bb9\u3002<\/li>\n<p><span class=\"token function\">cat<\/span> ~\/.ssh\/id_rsa.pub<\/p>\n<li>\u7528SSH\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;\u8f93\u5165\u5bc6\u7801\u767b\u5f55\u3002<\/li>\n<p><span class=\"token function\">ssh<\/span> username&#064;server_ip<\/p>\n<li>\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u521b\u5efa .ssh \u76ee\u5f55&#xff08;\u5982\u679c\u4e0d\u5b58\u5728&#xff09;&#xff1a;<\/li>\n<p><span class=\"token function\">mkdir<\/span> <span class=\"token parameter variable\">-p<\/span> ~\/.ssh<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">700<\/span> ~\/.ssh<\/p>\n<li>\u7f16\u8f91\u6216\u521b\u5efa authorized_keys \u6587\u4ef6&#xff0c;\u5e76\u5c06\u516c\u94a5\u8ffd\u52a0\u5230\u6587\u4ef6\u4e2d&#xff1a;<\/li>\n<p><span class=\"token builtin class-name\">echo<\/span> <span class=\"token string\">&#034;your_public_key_content&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> ~\/.ssh\/authorized_keys<br \/>\n<span class=\"token function\">chmod<\/span> <span class=\"token number\">600<\/span> ~\/.ssh\/authorized_keys<\/p>\n<h4>3.\u6d4b\u8bd5\u8fde\u63a5&#xff1a;<\/h4>\n<p>\u9000\u51fa\u8fdc\u7a0b\u670d\u52a1\u5668\u5e76\u5c1d\u8bd5\u4f7f\u7528SSH\u5bc6\u94a5\u767b\u5f55&#xff1a;<\/p>\n<p><span class=\"token function\">ssh<\/span> username&#064;server_ip<\/p>\n<p>\u5982\u679c\u6210\u529f\u767b\u5f55\u800c\u4e0d\u9700\u8981\u8f93\u5165\u5bc6\u7801&#xff0c;\u5219\u8bf4\u660e\u516c\u94a5\u590d\u5236\u6210\u529f\u3002\u8fd9\u4e9b\u6b65\u9aa4\u5b8c\u6210\u540e&#xff0c;\u4f60\u5e94\u8be5\u80fd\u591f\u4f7f\u7528SSH\u5bc6\u94a5\u8fdb\u884c\u65e0\u5bc6\u7801\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<h4>4.\u53ef\u80fd\u51fa\u73b0\u8b66\u544a<\/h4>\n<p>\u8fd9\u4e2a\u8b66\u544a\u63d0\u793a\u662f\u56e0\u4e3a\u8fdc\u7a0b\u4e3b\u673a\u7684\u8eab\u4efd\u9a8c\u8bc1\u4fe1\u606f\u53d1\u751f\u4e86\u53d8\u5316&#xff0c;\u53ef\u80fd\u662f\u7531\u4e8e\u4ee5\u4e0b\u539f\u56e0\u4e4b\u4e00&#xff1a;<\/p>\n<ul>\n<li>\u4e3b\u673a\u5bc6\u94a5\u5df2\u66f4\u6539&#xff1a;\u8fdc\u7a0b\u670d\u52a1\u5668\u7684 SSH \u5bc6\u94a5\u53ef\u80fd\u5df2\u7ecf\u66f4\u65b0\u6216\u66f4\u6539\u3002<\/li>\n<li>\u4e2d\u95f4\u4eba\u653b\u51fb&#xff1a;\u53ef\u80fd\u6709\u6076\u610f\u7b2c\u4e09\u65b9\u5728\u4f60\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u8fdb\u884c\u76d1\u542c\u3002 <img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420225056-68057a502f6b7.png\" alt=\"\u5728\u8fd9\u91cc\u63d2\u5165\u56fe\u7247\u63cf\u8ff0\" \/><\/li>\n<\/ul>\n<p>&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;<br \/>\n&#064;    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED<span class=\"token operator\">!<\/span>     &#064;<br \/>\n&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;&#064;<br \/>\nIT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY<span class=\"token operator\">!<\/span><br \/>\nSomeone could be eavesdropping on you right now <span class=\"token punctuation\">(<\/span>man-in-the-middle attack<span class=\"token punctuation\">)<\/span><span class=\"token operator\">!<\/span><br \/>\nIt is also possible that a <span class=\"token function\">host<\/span> key has just been changed.<br \/>\nThe fingerprint <span class=\"token keyword\">for<\/span> the ECDSA key sent by the remote <span class=\"token function\">host<\/span> is<br \/>\nSHA256:rorOjL7yjvcVHHyhMGHlXrI\/ivIc6ufFCz5Ic2eEVbA.<br \/>\nPlease contact your system administrator.<br \/>\nAdd correct <span class=\"token function\">host<\/span> key <span class=\"token keyword\">in<\/span> \/root\/.ssh\/known_hosts to get rid of this message.<br \/>\nOffending ECDSA key <span class=\"token keyword\">in<\/span> \/root\/.ssh\/known_hosts:5<br \/>\n  remove with:<br \/>\n  ssh-keygen <span class=\"token parameter variable\">-f<\/span> <span class=\"token string\">&#034;\/root\/.ssh\/known_hosts&#034;<\/span> <span class=\"token parameter variable\">-R<\/span> <span class=\"token string\">&#034;192.168.1.1&#034;<\/span><br \/>\nHost key <span class=\"token keyword\">for<\/span> <span class=\"token number\">192.168<\/span>.1.1 has changed and you have requested strict checking.<br \/>\nHost key verification failed.<\/p>\n<p>\u89e3\u51b3\u65b9\u6cd5&#xff1a;<\/p>\n<li>\u66f4\u65b0 known_hosts \u6587\u4ef6&#xff1a;<\/li>\n<p>\u5982\u679c\u4f60\u4fe1\u4efb\u670d\u52a1\u5668\u7684\u65b0\u5bc6\u94a5&#xff0c;\u53ef\u4ee5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0 known_hosts \u6587\u4ef6\u3002\u8bf7\u786e\u4fdd\u66ff\u6362 \u201c192.168.1.1\u201d \u4e3a\u5b9e\u9645\u7684\u670d\u52a1\u5668IP\u5730\u5740\u3002<\/p>\n<p>ssh-keygen <span class=\"token parameter variable\">-f<\/span> <span class=\"token string\">&#034;\/root\/.ssh\/known_hosts&#034;<\/span> <span class=\"token parameter variable\">-R<\/span> <span class=\"token string\">&#034;192.168.2.126&#034;<\/span><\/p>\n<p>\u7136\u540e\u518d\u6b21\u5c1d\u8bd5\u8fde\u63a5\u670d\u52a1\u5668&#xff0c;SSH \u5c06\u4f1a\u8be2\u95ee\u4f60\u662f\u5426\u63a5\u53d7\u65b0\u7684\u5bc6\u94a5\u3002<\/p>\n<li>\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458&#xff1a;<\/li>\n<p>\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u8fd9\u4e2a\u8b66\u544a\u7684\u539f\u56e0&#xff0c;\u6216\u8005\u8ba4\u4e3a\u53ef\u80fd\u5b58\u5728\u5b89\u5168\u95ee\u9898&#xff0c;\u5efa\u8bae\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\u8fdb\u4e00\u6b65\u786e\u8ba4\u670d\u52a1\u5668\u7684\u72b6\u6001\u548c\u5bc6\u94a5\u66f4\u6539\u7684\u539f\u56e0\u3002<\/p>\n<li>\u53d6\u6d88\u4e25\u683c\u4e3b\u673a\u5bc6\u94a5\u68c0\u67e5&#xff08;\u4e0d\u63a8\u8350&#xff09;&#xff1a;<\/li>\n<p>\u5982\u679c\u4f60\u786e\u8ba4\u670d\u52a1\u5668\u7684\u66f4\u6539\u662f\u5408\u6cd5\u7684&#xff0c;\u53ef\u4ee5\u5728 SSH \u8fde\u63a5\u65f6\u6dfb\u52a0 -o StrictHostKeyChecking&#061;no \u53c2\u6570\u6765\u4e34\u65f6\u53d6\u6d88\u4e25\u683c\u4e3b\u673a\u5bc6\u94a5\u68c0\u67e5\u3002\u4f46\u8fd9\u4f1a\u589e\u52a0\u6f5c\u5728\u7684\u5b89\u5168\u98ce\u9669&#xff0c;\u53ea\u9002\u7528\u4e8e\u4e34\u65f6\u8c03\u8bd5\u6216\u7279\u5b9a\u60c5\u51b5\u4e0b\u4f7f\u7528\u3002<\/p>\n<p><span class=\"token function\">ssh<\/span> <span class=\"token parameter variable\">-o<\/span> <span class=\"token assign-left variable\">StrictHostKeyChecking<\/span><span class=\"token operator\">&#061;<\/span>no user&#064;192.168.2.126<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.5k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u8f93\u5165\u5bc6\u7801\u540e\uff0cssh-copy-id \u4f1a\u81ea\u52a8\u5c06\u4f60\u7684\u516c\u94a5\u8ffd\u52a0\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684 ~\/.ssh\/authorized_keys \u6587\u4ef6\u4e2d\u3002\u5728 Windows \u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u6765\u7b80\u5316\u590d\u5236\u516c\u94a5\u7684\u8fc7\u7a0b\uff0c\u4f46\u901a\u5e38\u5b83\u5e76\u4e0d\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u3002\u56e0\u6b64\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u5728 Windows\u4e0a\u5c06\u672c\u5730\u751f\u6210\u7684 SSH \u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528 SSH \u5bc6\u94a5\u8fdb\u884c\u65e0\u5bc6\u7801\u767b\u5f55\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u8fd9\u4e2a\u8b66\u544a\u7684\u539f\u56e0\uff0c\u6216\u8005\u8ba4\u4e3a\u53ef\u80fd\u5b58\u5728\u5b89\u5168\u95ee\u9898\uff0c\u5efa\u8bae\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\u8fdb\u4e00\u6b65\u786e\u8ba4\u670d\u52a1\u5668\u7684\u72b6\u6001\u548c\u5bc6\u94a5\u66f4\u6539\u7684\u539f\u56e0\u3002_\u4e0a\u4f20\u516c\u94a5\u5230\u670d\u52a1\u5668<\/p>\n","protected":false},"author":2,"featured_media":30964,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,149,43],"topic":[],"class_list":["post-30965","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-windows","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/30965.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.5k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u8f93\u5165\u5bc6\u7801\u540e\uff0cssh-copy-id \u4f1a\u81ea\u52a8\u5c06\u4f60\u7684\u516c\u94a5\u8ffd\u52a0\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684 ~\/.ssh\/authorized_keys \u6587\u4ef6\u4e2d\u3002\u5728 Windows \u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u6765\u7b80\u5316\u590d\u5236\u516c\u94a5\u7684\u8fc7\u7a0b\uff0c\u4f46\u901a\u5e38\u5b83\u5e76\u4e0d\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u3002\u56e0\u6b64\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u5728 Windows\u4e0a\u5c06\u672c\u5730\u751f\u6210\u7684 SSH \u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528 SSH \u5bc6\u94a5\u8fdb\u884c\u65e0\u5bc6\u7801\u767b\u5f55\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u8fd9\u4e2a\u8b66\u544a\u7684\u539f\u56e0\uff0c\u6216\u8005\u8ba4\u4e3a\u53ef\u80fd\u5b58\u5728\u5b89\u5168\u95ee\u9898\uff0c\u5efa\u8bae\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\u8fdb\u4e00\u6b65\u786e\u8ba4\u670d\u52a1\u5668\u7684\u72b6\u6001\u548c\u5bc6\u94a5\u66f4\u6539\u7684\u539f\u56e0\u3002_\u4e0a\u4f20\u516c\u94a5\u5230\u670d\u52a1\u5668\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/30965.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-20T22:50:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420225056-68057a502f6b7.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30965.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/30965.html\",\"name\":\"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-20T22:50:57+00:00\",\"dateModified\":\"2025-04-20T22:50:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/30965.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/30965.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/30965.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/30965.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb2.5k\u6b21\uff0c\u70b9\u8d5e25\u6b21\uff0c\u6536\u85cf35\u6b21\u3002\u8f93\u5165\u5bc6\u7801\u540e\uff0cssh-copy-id \u4f1a\u81ea\u52a8\u5c06\u4f60\u7684\u516c\u94a5\u8ffd\u52a0\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684 ~\/.ssh\/authorized_keys \u6587\u4ef6\u4e2d\u3002\u5728 Windows \u4e0a\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 ssh-copy-id \u6765\u7b80\u5316\u590d\u5236\u516c\u94a5\u7684\u8fc7\u7a0b\uff0c\u4f46\u901a\u5e38\u5b83\u5e76\u4e0d\u662f\u9ed8\u8ba4\u5b89\u88c5\u7684\u3002\u56e0\u6b64\uff0c\u4f60\u53ef\u4ee5\u624b\u52a8\u590d\u5236\u516c\u94a5\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u3002\u901a\u8fc7\u8fd9\u4e9b\u6b65\u9aa4\uff0c\u4f60\u5e94\u8be5\u80fd\u591f\u5728 Windows\u4e0a\u5c06\u672c\u5730\u751f\u6210\u7684 SSH \u516c\u94a5\u590d\u5236\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u5e76\u4f7f\u7528 SSH \u5bc6\u94a5\u8fdb\u884c\u65e0\u5bc6\u7801\u767b\u5f55\u3002\u5982\u679c\u4f60\u4e0d\u786e\u5b9a\u8fd9\u4e2a\u8b66\u544a\u7684\u539f\u56e0\uff0c\u6216\u8005\u8ba4\u4e3a\u53ef\u80fd\u5b58\u5728\u5b89\u5168\u95ee\u9898\uff0c\u5efa\u8bae\u8054\u7cfb\u7cfb\u7edf\u7ba1\u7406\u5458\u8fdb\u4e00\u6b65\u786e\u8ba4\u670d\u52a1\u5668\u7684\u72b6\u6001\u548c\u5bc6\u94a5\u66f4\u6539\u7684\u539f\u56e0\u3002_\u4e0a\u4f20\u516c\u94a5\u5230\u670d\u52a1\u5668","og_url":"https:\/\/www.wsisp.com\/helps\/30965.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-20T22:50:57+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250420225056-68057a502f6b7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/30965.html","url":"https:\/\/www.wsisp.com\/helps\/30965.html","name":"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-20T22:50:57+00:00","dateModified":"2025-04-20T22:50:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/30965.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/30965.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/30965.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux\u548cWindows\u914d\u7f6e\u516c\u94a5\u5230\u670d\u52a1\u5668\u4e0a\u3010\u514d\u5bc6\u767b\u5f55\/\u4f20\u8f93\u6587\u4ef6\u3011"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/30965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=30965"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/30965\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/30964"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=30965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=30965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=30965"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=30965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}