{"id":13960,"date":"2025-04-18T20:48:24","date_gmt":"2025-04-18T12:48:24","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/13960.html"},"modified":"2025-04-18T20:48:24","modified_gmt":"2025-04-18T12:48:24","slug":"%e5%9c%a8-linux-%e4%b8%8a%e4%bf%9d%e6%8a%a4-ssh-%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bf%9e%e6%8e%a5%e7%9a%8415%e7%a7%8d%e6%8e%aa%e6%96%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/13960.html","title":{"rendered":"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd"},"content":{"rendered":"<h2>\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd<\/h2>\n<p>SSH&#xff08;Secure Shell&#xff09;\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u534f\u8bae&#xff0c;\u7528\u4e8e\u5b89\u5168\u5730\u8bbf\u95ee Linux \u670d\u52a1\u5668\u3002\u5c3d\u7ba1 SSH \u63d0\u4f9b\u4e86\u4e00\u5b9a\u7684\u5b89\u5168\u6027&#xff0c;\u4f46\u4e0d\u5b89\u5168\u7684\u9ed8\u8ba4\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5404\u79cd\u5b89\u5168\u98ce\u9669&#xff0c;\u7279\u522b\u662f\u5728\u5f00\u653e\u7684\u73af\u5883\u4e2d\u3002\u4e3a\u4e86\u4fdd\u62a4 SSH \u670d\u52a1\u5668&#xff0c;\u4ee5\u4e0b\u662f\u51e0\u79cd\u6709\u6548\u7684\u5b89\u5168\u63aa\u65bd\u3002<\/p>\n<h3>1. \u7981\u7528 Root \u7528\u6237\u767b\u5f55<\/h3>\n<p>\u7981\u7528 root \u7528\u6237\u7684 SSH \u8bbf\u95ee\u662f\u589e\u5f3a\u5b89\u5168\u6027\u7684\u57fa\u672c\u6b65\u9aa4\u3002\u653b\u51fb\u8005\u901a\u5e38\u4f1a\u9996\u5148\u5c1d\u8bd5\u7834\u89e3 root \u5bc6\u7801&#xff0c;\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u5177\u6709\u7ba1\u7406\u6743\u9650\u7684\u65b0\u7528\u6237\u662f\u660e\u667a\u4e4b\u4e3e\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\u5e76\u8d4b\u4e88\u5176 sudo \u6743\u9650&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">useradd<\/span> -m exampleroot<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">passwd<\/span> exampleroot<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">usermod<\/span> -aG <span class=\"token function\">sudo<\/span> exampleroot\n <\/li>\n<li>\n<p>\u4fee\u6539 SSH \u914d\u7f6e\u6587\u4ef6 \/etc\/ssh\/sshd_config&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p> PermitRootLogin no<br \/>\nAllowUsers exampleroot\n <\/li>\n<li>\n<p>\u91cd\u542f SSH \u670d\u52a1&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl restart sshd\n <\/li>\n<h3>2. \u66f4\u6539\u9ed8\u8ba4\u7aef\u53e3<\/h3>\n<p>\u9ed8\u8ba4\u7684 SSH \u8fde\u63a5\u7aef\u53e3\u662f 22&#xff0c;\u653b\u51fb\u8005\u5e38\u5e38\u4f1a\u9488\u5bf9\u8fd9\u4e2a\u7aef\u53e3\u8fdb\u884c\u626b\u63cf\u3002\u901a\u8fc7\u66f4\u6539 SSH \u7684\u7aef\u53e3\u53f7&#xff0c;\u53ef\u4ee5\u964d\u4f4e\u53d7\u5230\u653b\u51fb\u7684\u98ce\u9669\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u6253\u5f00 \/etc\/ssh\/sshd_config \u6587\u4ef6&#xff0c;\u627e\u5230\u5e76\u66f4\u6539\u7aef\u53e3\u53f7&#xff1a;<\/p>\n<p> Port <span class=\"token number\">22099<\/span>\n <\/li>\n<li>\n<p>\u91cd\u542f SSH \u670d\u52a1\u4ee5\u5e94\u7528\u66f4\u6539&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> systemctl restart sshd\n <\/li>\n<li>\n<p>\u786e\u4fdd\u9632\u706b\u5899\u5141\u8bb8\u65b0\u7684\u7aef\u53e3\u53f7\u901a\u8fc7\u3002<\/p>\n<\/li>\n<h3>3. \u7981\u6b62\u7a7a\u5bc6\u7801\u7528\u6237\u8bbf\u95ee<\/h3>\n<p>\u7a7a\u5bc6\u7801\u7684\u7528\u6237\u8d26\u6237\u53ef\u80fd\u4f1a\u88ab\u653b\u51fb\u8005\u5229\u7528\u3002\u4e3a\u4e86\u9632\u6b62\u8fd9\u79cd\u60c5\u51b5&#xff0c;\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u7981\u6b62\u7a7a\u5bc6\u7801\u767b\u5f55\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u5728 \/etc\/ssh\/sshd_config \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> PermitEmptyPasswords no\n <\/li>\n<h3>4. \u9650\u5236\u767b\u5f55\u5c1d\u8bd5\u6b21\u6570<\/h3>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;SSH \u5141\u8bb8\u591a\u6b21\u8f93\u5165\u5bc6\u7801\u3002\u5982\u679c\u653b\u51fb\u8005\u5c1d\u8bd5\u66b4\u529b\u7834\u89e3&#xff0c;\u9650\u5236\u767b\u5f55\u5c1d\u8bd5\u6b21\u6570\u5c06\u6709\u6548\u9632\u6b62\u8fd9\u79cd\u653b\u51fb\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u4fee\u6539 \/etc\/ssh\/sshd_config \u6587\u4ef6&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> MaxAuthTries <span class=\"token number\">3<\/span>\n <\/li>\n<h3>5. \u4f7f\u7528 SSH \u7248\u672c 2<\/h3>\n<p>SSH \u7684\u7b2c\u4e8c\u4e2a\u7248\u672c\u6bd4\u7b2c\u4e00\u4e2a\u7248\u672c\u66f4\u5b89\u5168\u3002\u786e\u4fdd\u670d\u52a1\u5668\u53ea\u63a5\u53d7 SSH \u7248\u672c 2 \u7684\u8fde\u63a5\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u5728 \/etc\/ssh\/sshd_config \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> Protocol <span class=\"token number\">2<\/span>\n <\/li>\n<h3>6. \u5173\u95ed TCP \u7aef\u53e3\u8f6c\u53d1\u548c X11 \u8f6c\u53d1<\/h3>\n<p>\u5173\u95ed TCP \u7aef\u53e3\u8f6c\u53d1\u548c X11 \u8f6c\u53d1\u53ef\u4ee5\u9632\u6b62\u653b\u51fb\u8005\u5229\u7528 SSH \u8fde\u63a5\u8bbf\u95ee\u5176\u4ed6\u7cfb\u7edf\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u5728 \/etc\/ssh\/sshd_config \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> AllowTcpForwarding no<br \/>\nX11Forwarding no\n <\/li>\n<h3>7. \u4f7f\u7528 SSH \u5bc6\u94a5\u8fde\u63a5<\/h3>\n<p>\u4f7f\u7528 SSH \u5bc6\u94a5\u800c\u4e0d\u662f\u5bc6\u7801\u8fde\u63a5\u662f\u63d0\u9ad8\u5b89\u5168\u6027\u7684\u6709\u6548\u65b9\u5f0f\u3002SSH \u5bc6\u94a5\u5305\u62ec\u516c\u94a5\u548c\u79c1\u94a5&#xff0c;\u516c\u94a5\u5b58\u50a8\u5728\u670d\u52a1\u5668\u4e0a&#xff0c;\u79c1\u94a5\u5b58\u50a8\u5728\u5ba2\u6237\u7aef\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u751f\u6210 SSH \u5bc6\u94a5&#xff1a;<\/p>\n<p> ssh-keygen\n <\/li>\n<li>\n<p>\u5c06\u516c\u94a5\u4e0a\u4f20\u5230\u670d\u52a1\u5668&#xff1a;<\/p>\n<p> ssh-copy-id exampleroot&#064;your_server_ip\n <\/li>\n<li>\n<p>\u5728 \/etc\/ssh\/sshd_config \u6587\u4ef6\u4e2d\u7981\u7528\u5bc6\u7801\u8ba4\u8bc1&#xff1a;<\/p>\n<p> PasswordAuthentication no\n <\/li>\n<h3>8. \u9650\u5236 SSH \u8fde\u63a5\u7684 IP \u5730\u5740<\/h3>\n<p>\u901a\u8fc7\u9650\u5236\u7279\u5b9a IP \u5730\u5740\u7684\u8bbf\u95ee&#xff0c;\u53ef\u4ee5\u8fdb\u4e00\u6b65\u63d0\u9ad8\u5b89\u5168\u6027\u3002\u53ef\u4ee5\u5728 \/etc\/hosts.allow \u6587\u4ef6\u4e2d\u914d\u7f6e\u5141\u8bb8\u548c\u62d2\u7edd\u7684 IP \u5730\u5740\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u7f16\u8f91 \/etc\/hosts.allow \u6587\u4ef6&#xff0c;\u6dfb\u52a0\u5141\u8bb8\u7684 IP \u5730\u5740&#xff1a;<\/p>\n<p> sshd: <span class=\"token number\">192.168<\/span>.1.0\/255.255.255.0\n <\/li>\n<li>\n<p>\u7f16\u8f91 \/etc\/hosts.deny \u6587\u4ef6&#xff0c;\u62d2\u7edd\u6240\u6709\u5176\u4ed6 IP \u5730\u5740&#xff1a;<\/p>\n<p> sshd: ALL\n <\/li>\n<h3>9. \u4f7f\u7528\u9632\u706b\u5899<\/h3>\n<p>\u4f7f\u7528\u9632\u706b\u5899&#xff08;\u5982 iptables \u6216 ufw&#xff09;\u53ef\u4ee5\u5e2e\u52a9\u9650\u5236\u5bf9 SSH \u7684\u8bbf\u95ee\u3002\u53ef\u4ee5\u8bbe\u7f6e\u89c4\u5219&#xff0c;\u4ec5\u5141\u8bb8\u7279\u5b9a IP \u5730\u5740\u6216 IP \u8303\u56f4\u8bbf\u95ee SSH \u670d\u52a1\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<ul>\n<li>\n<p>\u4f7f\u7528 ufw&#xff08;\u7b80\u5355\u6613\u7528\u7684\u9632\u706b\u5899&#xff09;&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> ufw allow from <span class=\"token number\">192.168<\/span>.1.0\/24 to any port <span class=\"token number\">22099<\/span><br \/>\n<span class=\"token function\">sudo<\/span> ufw <span class=\"token builtin class-name\">enable<\/span>\n <\/li>\n<li>\n<p>\u4f7f\u7528 iptables&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> iptables -A INPUT -p tcp -s <span class=\"token number\">192.168<\/span>.1.0\/24 &#8211;dport <span class=\"token number\">22099<\/span> -j ACCEPT<br \/>\n<span class=\"token function\">sudo<\/span> iptables -A INPUT -p tcp &#8211;dport <span class=\"token number\">22099<\/span> -j DROP\n <\/li>\n<\/ul>\n<h3>10. \u76d1\u63a7\u767b\u5f55\u5c1d\u8bd5<\/h3>\n<p>\u4f7f\u7528\u5de5\u5177&#xff08;\u5982 fail2ban&#xff09;\u76d1\u63a7 SSH \u767b\u5f55\u5c1d\u8bd5&#xff0c;\u53ef\u4ee5\u5728\u68c0\u6d4b\u5230\u591a\u6b21\u5931\u8d25\u5c1d\u8bd5\u540e\u81ea\u52a8\u963b\u6b62\u8be5 IP \u5730\u5740\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u5b89\u88c5 fail2ban&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> fail2ban\n <\/li>\n<li>\n<p>\u914d\u7f6e \/etc\/fail2ban\/jail.local&#xff0c;\u542f\u7528 SSH \u76d1\u63a7&#xff1a;<\/p>\n<p> [sshd]<br \/>\nenabled &#061; true<br \/>\nmaxretry &#061; 3<br \/>\nbantime &#061; 600\n <\/li>\n<h3>11. \u4f7f\u7528\u591a\u56e0\u7d20\u8ba4\u8bc1 (MFA)<\/h3>\n<p>\u542f\u7528\u591a\u56e0\u7d20\u8ba4\u8bc1\u589e\u52a0\u4e86\u4e00\u5c42\u5b89\u5168\u6027&#xff0c;\u5373\u4f7f\u5bc6\u7801\u88ab\u6cc4\u9732&#xff0c;\u4e5f\u96be\u4ee5\u901a\u8fc7 SSH \u767b\u5f55\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u5b89\u88c5 libpam-google-authenticator&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> <span class=\"token function\">install<\/span> libpam-google-authenticator\n <\/li>\n<li>\n<p>\u5728\u7528\u6237\u76ee\u5f55\u4e2d\u8fd0\u884c google-authenticator \u547d\u4ee4&#xff0c;\u6839\u636e\u63d0\u793a\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539 \/etc\/pam.d\/sshd \u6587\u4ef6&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> auth required pam_google_authenticator.so\n <\/li>\n<li>\n<p>\u5728 \/etc\/ssh\/sshd_config \u4e2d\u786e\u4fdd ChallengeResponseAuthentication \u8bbe\u7f6e\u4e3a yes&#xff1a;<\/p>\n<p> ChallengeResponseAuthentication <span class=\"token function\">yes<\/span>\n <\/li>\n<h3>12. \u5b9a\u671f\u5ba1\u8ba1\u548c\u66f4\u65b0<\/h3>\n<p>\u5b9a\u671f\u68c0\u67e5 SSH \u914d\u7f6e\u6587\u4ef6&#xff0c;\u5ba1\u8ba1\u7528\u6237\u8d26\u6237\u548c\u6743\u9650&#xff0c;\u786e\u4fdd\u6ca1\u6709\u672a\u4f7f\u7528\u7684\u8d26\u6237\u6216\u8fc7\u671f\u7684\u5bc6\u94a5\u3002\u540c\u65f6&#xff0c;\u5b9a\u671f\u66f4\u65b0\u7cfb\u7edf\u548c SSH \u8f6f\u4ef6&#xff0c;\u4ee5\u4fee\u590d\u5df2\u77e5\u7684\u5b89\u5168\u6f0f\u6d1e\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<ul>\n<li>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u66f4\u65b0\u7cfb\u7edf&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt-get<\/span> upgrade\n <\/li>\n<\/ul>\n<h3>13. \u7981\u7528 IPv6&#xff08;\u5982\u679c\u4e0d\u9700\u8981&#xff09;<\/h3>\n<p>\u5982\u679c\u4e0d\u4f7f\u7528 IPv6&#xff0c;\u53ef\u4ee5\u8003\u8651\u7981\u7528\u5b83&#xff0c;\u4ee5\u51cf\u5c11\u6f5c\u5728\u7684\u653b\u51fb\u9762\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u7f16\u8f91 \/etc\/sysctl.conf \u6587\u4ef6&#xff0c;\u6dfb\u52a0\u4ee5\u4e0b\u884c&#xff1a;<\/p>\n<p> net.ipv6.conf.all.disable_ipv6 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span><br \/>\nnet.ipv6.conf.default.disable_ipv6 <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">1<\/span>\n <\/li>\n<li>\n<p>\u5e94\u7528\u66f4\u6539&#xff1a;<\/p>\n<p> <span class=\"token function\">sudo<\/span> sysctl -p\n <\/li>\n<h3>14. \u4f7f\u7528 SSH \u4ee3\u7406<\/h3>\n<p>SSH \u4ee3\u7406\u53ef\u4ee5\u5b58\u50a8\u4f60\u7684\u5bc6\u94a5\u5e76\u5728\u9700\u8981\u65f6\u81ea\u52a8\u4f7f\u7528&#xff0c;\u63d0\u9ad8\u5b89\u5168\u6027\u548c\u4fbf\u5229\u6027\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\n<p>\u542f\u52a8 SSH \u4ee3\u7406&#xff1a;<\/p>\n<p> <span class=\"token builtin class-name\">eval<\/span> <span class=\"token string\">&#034;<span class=\"token variable\"><span class=\"token variable\">$(<\/span>ssh-agent -s<span class=\"token variable\">)<\/span><\/span>&#034;<\/span>\n <\/li>\n<li>\n<p>\u6dfb\u52a0\u79c1\u94a5&#xff1a;<\/p>\n<p> ssh-add ~\/.ssh\/id_rsa\n <\/li>\n<h3>15. \u8bbe\u7f6e\u767b\u5f55\u901a\u77e5<\/h3>\n<p>\u4f7f\u7528\u90ae\u4ef6\u6216\u5176\u4ed6\u901a\u77e5\u7cfb\u7edf&#xff0c;\u5f53\u6709\u65b0\u7684 SSH \u767b\u5f55\u65f6\u63a5\u6536\u901a\u77e5&#xff0c;\u4ee5\u4fbf\u53ca\u65f6\u53d1\u73b0\u53ef\u7591\u6d3b\u52a8\u3002<\/p>\n<h4>\u64cd\u4f5c\u6b65\u9aa4&#xff1a;<\/h4>\n<li>\u5728 \/etc\/ssh\/sshd_config \u6587\u4ef6\u4e2d\u542f\u7528 PermitRootLogin no \u548c\u5176\u4ed6\u914d\u7f6e\u3002<\/li>\n<li>\u4f7f\u7528 auditd \u6216 syslog \u76d1\u63a7\u767b\u5f55\u4e8b\u4ef6\u3002<\/li>\n<h3>\u7ed3\u8bba<\/h3>\n<p>\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u7684\u5b89\u5168\u6027\u662f\u6bcf\u4e2a\u7cfb\u7edf\u7ba1\u7406\u5458\u7684\u57fa\u672c\u804c\u8d23\u3002\u901a\u8fc7\u5b9e\u65bd\u4e0a\u8ff0\u63aa\u65bd&#xff0c;\u53ef\u4ee5\u663e\u8457\u964d\u4f4e\u670d\u52a1\u5668\u88ab\u653b\u51fb\u7684\u98ce\u9669&#xff0c;\u786e\u4fdd\u6570\u636e\u7684\u5b89\u5168\u6027\u3002\u5b9a\u671f\u5ba1\u67e5\u548c\u66f4\u65b0\u8fd9\u4e9b\u914d\u7f6e\u5c06\u6709\u52a9\u4e8e\u7ef4\u62a4\u5b89\u5168\u73af\u5883\u3002<\/p>\n<p>\u901a\u8fc7\u7ed3\u5408\u4e0a\u8ff0\u591a\u79cd\u63aa\u65bd&#xff0c;\u53ef\u4ee5\u663e\u8457\u63d0\u9ad8 SSH \u670d\u52a1\u5668\u7684\u5b89\u5168\u6027&#xff0c;\u964d\u4f4e\u906d\u53d7\u653b\u51fb\u7684\u98ce\u9669\u3002\u59cb\u7ec8\u4fdd\u6301\u8b66\u60d5&#xff0c;\u5e76\u5b9a\u671f\u68c0\u67e5\u548c\u66f4\u65b0\u5b89\u5168\u7b56\u7565&#xff0c;\u4ee5\u786e\u4fdd\u7cfb\u7edf\u7684\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e31\u6b21\uff0c\u6536\u85cf12\u6b21\u3002SSH\uff08Secure Shell\uff09\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u7528\u4e8e\u5b89\u5168\u5730\u8bbf\u95ee Linux \u670d\u52a1\u5668\u3002\u5c3d\u7ba1 SSH \u63d0\u4f9b\u4e86\u4e00\u5b9a\u7684\u5b89\u5168\u6027\uff0c\u4f46\u4e0d\u5b89\u5168\u7684\u9ed8\u8ba4\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5404\u79cd\u5b89\u5168\u98ce\u9669\uff0c\u7279\u522b\u662f\u5728\u5f00\u653e\u7684\u73af\u5883\u4e2d\u3002\u4e3a\u4e86\u4fdd\u62a4 SSH \u670d\u52a1\u5668\uff0c\u4ee5\u4e0b\u662f\u51e0\u79cd\u6709\u6548\u7684\u5b89\u5168\u63aa\u65bd\u3002_ssh\u670d\u52a1\u5668\u5b89\u5168\u8fde\u63a5<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[868,58,77,43,44],"topic":[],"class_list":["post-13960","post","type-post","status-publish","format-standard","hentry","category-server","tag-868","tag-linux","tag-ssh","tag-43","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \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\/13960.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e31\u6b21\uff0c\u6536\u85cf12\u6b21\u3002SSH\uff08Secure Shell\uff09\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u7528\u4e8e\u5b89\u5168\u5730\u8bbf\u95ee Linux \u670d\u52a1\u5668\u3002\u5c3d\u7ba1 SSH \u63d0\u4f9b\u4e86\u4e00\u5b9a\u7684\u5b89\u5168\u6027\uff0c\u4f46\u4e0d\u5b89\u5168\u7684\u9ed8\u8ba4\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5404\u79cd\u5b89\u5168\u98ce\u9669\uff0c\u7279\u522b\u662f\u5728\u5f00\u653e\u7684\u73af\u5883\u4e2d\u3002\u4e3a\u4e86\u4fdd\u62a4 SSH \u670d\u52a1\u5668\uff0c\u4ee5\u4e0b\u662f\u51e0\u79cd\u6709\u6548\u7684\u5b89\u5168\u63aa\u65bd\u3002_ssh\u670d\u52a1\u5668\u5b89\u5168\u8fde\u63a5\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/13960.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-18T12:48:24+00:00\" \/>\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\/13960.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/13960.html\",\"name\":\"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T12:48:24+00:00\",\"dateModified\":\"2025-04-18T12:48:24+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/13960.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/13960.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/13960.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd\"}]},{\"@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":"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \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\/13960.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.5k\u6b21\uff0c\u70b9\u8d5e31\u6b21\uff0c\u6536\u85cf12\u6b21\u3002SSH\uff08Secure Shell\uff09\u662f\u4e00\u79cd\u5e7f\u6cdb\u4f7f\u7528\u7684\u534f\u8bae\uff0c\u7528\u4e8e\u5b89\u5168\u5730\u8bbf\u95ee Linux \u670d\u52a1\u5668\u3002\u5c3d\u7ba1 SSH \u63d0\u4f9b\u4e86\u4e00\u5b9a\u7684\u5b89\u5168\u6027\uff0c\u4f46\u4e0d\u5b89\u5168\u7684\u9ed8\u8ba4\u914d\u7f6e\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5404\u79cd\u5b89\u5168\u98ce\u9669\uff0c\u7279\u522b\u662f\u5728\u5f00\u653e\u7684\u73af\u5883\u4e2d\u3002\u4e3a\u4e86\u4fdd\u62a4 SSH \u670d\u52a1\u5668\uff0c\u4ee5\u4e0b\u662f\u51e0\u79cd\u6709\u6548\u7684\u5b89\u5168\u63aa\u65bd\u3002_ssh\u670d\u52a1\u5668\u5b89\u5168\u8fde\u63a5","og_url":"https:\/\/www.wsisp.com\/helps\/13960.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T12:48:24+00:00","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\/13960.html","url":"https:\/\/www.wsisp.com\/helps\/13960.html","name":"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T12:48:24+00:00","dateModified":"2025-04-18T12:48:24+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/13960.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/13960.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/13960.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5728 Linux \u4e0a\u4fdd\u62a4 SSH \u670d\u52a1\u5668\u8fde\u63a5\u768415\u79cd\u63aa\u65bd"}]},{"@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\/13960","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=13960"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/13960\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=13960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=13960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=13960"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=13960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}