{"id":47700,"date":"2025-07-30T08:51:49","date_gmt":"2025-07-30T00:51:49","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/47700.html"},"modified":"2025-07-30T08:51:49","modified_gmt":"2025-07-30T00:51:49","slug":"centos%e6%9c%8d%e5%8a%a1%e5%99%a8ssh%e8%bf%9c%e7%a8%8b%e8%bf%9e%e6%8e%a5%e5%85%a8%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/47700.html","title":{"rendered":"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357"},"content":{"rendered":"<h2>&#x1f4bb;CentOS \u670d\u52a1\u5668 SSH \u8fdc\u7a0b\u8fde\u63a5\u5168\u653b\u7565&#xff5c;\u4ece\u5b89\u88c5\u5230\u5b89\u5168\u914d\u7f6e\u4fdd\u59c6\u7ea7\u6559\u7a0b<\/h2>\n<p>\u4f5c\u4e3a\u8fd0\u7ef4\u65b0\u624b\u7b2c\u4e00\u6b21\u63a5\u89e6 CentOS \u670d\u52a1\u5668\u65f6&#xff0c;\u88ab SSH \u914d\u7f6e\u641e\u5f97\u7126\u5934\u70c2\u989d&#xff01;\u6574\u7406\u4e86\u4ece\u5b89\u88c5\u5230\u9ad8\u7ea7\u5b89\u5168\u8bbe\u7f6e\u7684\u5168\u6d41\u7a0b&#xff0c;\u9644\u8d85\u8be6\u7ec6\u547d\u4ee4\u548c\u907f\u5751\u6307\u5357&#xff0c;\u624b\u628a\u624b\u6559\u4f60\u641e\u5b9a\u8fdc\u7a0b\u8fde\u63a5&#x1f447;<\/p>\n<h3>&#x1f4cc; \u57fa\u7840\u6982\u5ff5\u626b\u76f2<\/h3>\n<p>SSH&#xff08;Secure Shell&#xff09;&#xff1a;Linux \u670d\u52a1\u5668\u6700\u5e38\u7528\u7684\u8fdc\u7a0b\u7ba1\u7406\u534f\u8bae&#xff0c;\u901a\u8fc7\u52a0\u5bc6\u4f20\u8f93\u9632\u6b62\u6570\u636e\u7a83\u542c\u3002\u5b83\u91c7\u7528\u975e\u5bf9\u79f0\u52a0\u5bc6\u6280\u672f&#xff0c;\u5728\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u5efa\u7acb\u5b89\u5168\u901a\u9053&#xff0c;\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u4e2d\u95f4\u4eba\u653b\u51fb\u3002SSH \u534f\u8bae\u7531\u82ac\u5170\u5b66\u8005 Tatu Yl\u00f6nen \u4e8e 1995 \u5e74\u8bbe\u8ba1&#xff0c;\u662f\u76ee\u524d\u6700\u5b89\u5168\u7684\u8fdc\u7a0b\u767b\u5f55\u65b9\u5f0f\u4e4b\u4e00\u3002<\/p>\n<p>\u9ed8\u8ba4\u7aef\u53e3&#xff1a;22&#xff08;\u5efa\u8bae\u4fee\u6539\u4e3a\u975e\u9ed8\u8ba4\u7aef\u53e3\u63d0\u9ad8\u5b89\u5168\u6027&#xff09;\u3002\u5e38\u89c1\u7684\u66ff\u4ee3\u7aef\u53e3\u6709&#xff1a;2222\u30013333\u30014444 \u7b49&#xff0c;\u4f46\u907f\u514d\u4f7f\u7528\u5e38\u89c1\u670d\u52a1\u7aef\u53e3&#xff08;\u5982 80\u3001443&#xff09;\u3002\u7aef\u53e3\u53f7\u8303\u56f4\u5e94\u5728 1024-49151 \u4e4b\u95f4&#xff0c;\u4f4e\u4e8e 1024 \u7684\u7aef\u53e3\u901a\u5e38\u4e3a\u7cfb\u7edf\u4fdd\u7559\u7aef\u53e3\u3002<\/p>\n<p>\u4e24\u79cd\u8ba4\u8bc1\u65b9\u5f0f&#xff1a; \u2705 \u5bc6\u7801\u8ba4\u8bc1&#xff08;\u9002\u5408\u65b0\u624b&#xff09;&#xff1a;\u7b80\u5355\u6613\u7528&#xff0c;\u4f46\u5b89\u5168\u6027\u8f83\u4f4e&#xff0c;\u5bb9\u6613\u53d7\u5230\u66b4\u529b\u7834\u89e3\u653b\u51fb \u2705 \u5bc6\u94a5\u8ba4\u8bc1&#xff08;\u66f4\u5b89\u5168&#xff0c;\u63a8\u8350\u751f\u4ea7\u73af\u5883&#xff09;&#xff1a;\u91c7\u7528\u975e\u5bf9\u79f0\u52a0\u5bc6&#xff0c;\u5b89\u5168\u6027\u9ad8&#xff0c;\u907f\u514d\u4e86\u5bc6\u7801\u6cc4\u9732\u98ce\u9669<\/p>\n<h3>\u4e00\u3001\u5b89\u88c5\u4e0e\u542f\u52a8 SSH \u670d\u52a1<\/h3>\n<h4>1. \u68c0\u67e5\u662f\u5426\u5df2\u5b89\u88c5<\/h4>\n<p># \u67e5\u770bSSH\u670d\u52a1\u72b6\u6001<br \/>\nsystemctl status sshd<br \/>\n# \u82e5\u663e\u793a&#034;active (running)&#034;\u5219\u5df2\u5b89\u88c5&#xff0c;\u5426\u5219\u6267\u884c\u5b89\u88c5\u547d\u4ee4<br \/>\n# \u4e5f\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5\u5b89\u88c5\u5305<br \/>\nrpm -qa | grep openssh-server<\/p>\n<h4>2. \u5b89\u88c5 OpenSSH \u670d\u52a1&#xff08;CentOS 7\/8 \u901a\u7528&#xff09;<\/h4>\n<p># CentOS 7\/8\u5b89\u88c5\u547d\u4ee4\u76f8\u540c<br \/>\nyum install openssh-server openssh-clients -y<br \/>\n# \u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u67e5\u770b\u7248\u672c<br \/>\nssh -V<\/p>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e&#xff0c;\u7cfb\u7edf\u4f1a\u81ea\u52a8\u521b\u5efa\u4ee5\u4e0b\u91cd\u8981\u6587\u4ef6&#xff1a;<\/p>\n<ul>\n<li>\u670d\u52a1\u7aef\u7a0b\u5e8f&#xff1a;\/usr\/sbin\/sshd<\/li>\n<li>\u5ba2\u6237\u7aef\u7a0b\u5e8f&#xff1a;\/usr\/bin\/ssh<\/li>\n<li>\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/ssh\/sshd_config&#xff08;\u670d\u52a1\u5668\u914d\u7f6e&#xff09;<\/li>\n<li>\u5ba2\u6237\u7aef\u914d\u7f6e\u6587\u4ef6&#xff1a;\/etc\/ssh\/ssh_config&#xff08;\u53ef\u9009\u914d\u7f6e&#xff09;<\/li>\n<li>\u5bc6\u94a5\u6587\u4ef6\u5b58\u50a8\u76ee\u5f55&#xff1a;\/etc\/ssh\/ssh_host_*_key<\/li>\n<\/ul>\n<h4>3. \u542f\u52a8\u5e76\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f<\/h4>\n<p># \u542f\u52a8SSH\u670d\u52a1<br \/>\nsystemctl start sshd<br \/>\n# \u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8<br \/>\nsystemctl enable sshd<br \/>\n# \u9a8c\u8bc1\u670d\u52a1\u72b6\u6001<br \/>\nsystemctl is-enabled sshd<\/p>\n<h3>\u4e8c\u3001\u8fdc\u7a0b\u8fde\u63a5\u5b9e\u6218&#xff08;Windows\/Mac \u901a\u7528&#xff09;<\/h3>\n<h4>\u25b6 Windows \u7528\u6237&#xff08;\u63a8\u8350 PuTTY \u5de5\u5177&#xff09;<\/h4>\n<li>\u4ece\u5b98\u7f51 Download PuTTY &#8211; a free SSH and telnet client for Windows \u4e0b\u8f7d PuTTY<\/li>\n<li>\u8fd0\u884c PuTTY&#xff0c;\u5728&#034;Host Name (or IP address)&#034;\u8f93\u5165\u670d\u52a1\u5668 IP<\/li>\n<li>\u5728&#034;Port&#034;\u8f93\u5165 SSH \u7aef\u53e3&#xff08;\u9ed8\u8ba4 22&#xff09;<\/li>\n<li>\u70b9\u51fb&#034;Open&#034;\u6309\u94ae\u8fde\u63a5<\/li>\n<li>\u9996\u6b21\u8fde\u63a5\u4f1a\u5f39\u51fa\u5b89\u5168\u8b66\u544a\u7a97\u53e3&#xff08;&#034;The server&#039;s host key is not cached&#034;&#xff09;&#xff0c;\u70b9\u51fb&#034;\u662f&#034;\u4fdd\u5b58\u670d\u52a1\u5668\u6307\u7eb9<\/li>\n<li>\u5728\u7ec8\u7aef\u7a97\u53e3\u8f93\u5165\u7528\u6237\u540d\u548c\u5bc6\u7801\u5b8c\u6210\u767b\u5f55<\/li>\n<li>\u53ef\u9009&#xff1a;\u4fdd\u5b58\u4f1a\u8bdd\u914d\u7f6e\u65b9\u4fbf\u4e0b\u6b21\u8fde\u63a5<\/li>\n<h4>\u25b6 Mac\/Linux \u7528\u6237&#xff08;\u81ea\u5e26\u7ec8\u7aef&#xff09;<\/h4>\n<p># \u57fa\u672c\u8fde\u63a5\u683c\u5f0f&#xff1a;ssh \u7528\u6237\u540d&#064;\u670d\u52a1\u5668IP -p \u7aef\u53e3&#xff08;\u9ed8\u8ba422\u53ef\u7701\u7565&#xff09;<br \/>\nssh admin&#064;192.168.1.100<\/p>\n<p># \u8fde\u63a5\u7aef\u53e3\u4e3a2222\u7684\u670d\u52a1\u5668<br \/>\nssh user&#064;server.com -p 2222<\/p>\n<p># \u4f7f\u7528\u7279\u5b9a\u79c1\u94a5\u8fde\u63a5<br \/>\nssh -i ~\/.ssh\/custom_key.pem user&#064;server.com<\/p>\n<p># \u8be6\u7ec6\u8f93\u51fa\u6a21\u5f0f&#xff08;\u8c03\u8bd5\u7528&#xff09;<br \/>\nssh -v user&#064;server.com<\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u914d\u7f6e\u6587\u4ef6\u4fee\u6539&#xff08;\u91cd\u70b9&#xff01;&#xff09;<\/h3>\n<h4>1. \u8fdb\u5165\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55<\/h4>\n<p>cd \/etc\/ssh\/<br \/>\n# \u5148\u5907\u4efd\u539f\u914d\u7f6e\u6587\u4ef6&#xff08;\u9632\u6b62\u6539\u5d29&#xff09;<br \/>\ncp sshd_config sshd_config.bak<br \/>\n# \u8bbe\u7f6e\u914d\u7f6e\u6587\u4ef6\u6743\u9650&#xff08;\u4ec5root\u53ef\u5199&#xff09;<br \/>\nchmod 600 sshd_config<\/p>\n<h4>2. \u5e38\u7528\u5b89\u5168\u914d\u7f6e\u4fee\u6539&#xff08;\u7528 vi\/vim \u7f16\u8f91&#xff09;<\/h4>\n<p>vim sshd_config<\/p>\n<p>\u63a8\u8350\u4fee\u6539\u9879&#xff08;\u53d6\u6d88\u6ce8\u91ca\u5e76\u4fee\u6539&#xff09;&#xff1a;<\/p>\n<p># \u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3&#xff08;\u907f\u514d\u88ab\u66b4\u529b\u7834\u89e3&#xff09;<br \/>\nPort 2222<\/p>\n<p># \u7981\u6b62root\u7528\u6237\u76f4\u63a5\u767b\u5f55&#xff08;\u63d0\u9ad8\u5b89\u5168\u6027&#xff09;<br \/>\nPermitRootLogin no<\/p>\n<p># \u542f\u7528\u5bc6\u94a5\u8ba4\u8bc1&#xff08;\u66f4\u5b89\u5168&#xff09;<br \/>\nPubkeyAuthentication yes<\/p>\n<p># \u7981\u6b62\u5bc6\u7801\u8ba4\u8bc1&#xff08;\u914d\u5408\u5bc6\u94a5\u8ba4\u8bc1\u4f7f\u7528&#xff09;<br \/>\nPasswordAuthentication no<\/p>\n<p># \u9650\u5236\u53ef\u767b\u5f55\u7528\u6237&#xff08;\u591a\u4e2a\u7528\u6237\u7528\u7a7a\u683c\u5206\u9694&#xff09;<br \/>\nAllowUsers admin devops backup<\/p>\n<p># \u9650\u5236\u6700\u5927\u5c1d\u8bd5\u6b21\u6570&#xff08;\u9632\u66b4\u529b\u7834\u89e3&#xff09;<br \/>\nMaxAuthTries 3<\/p>\n<p># \u8bbe\u7f6e\u7a7a\u95f2\u8d85\u65f6\u65f6\u95f4&#xff08;\u5355\u4f4d\u79d2&#xff09;<br \/>\nClientAliveInterval 300<br \/>\nClientAliveCountMax 0<\/p>\n<p># \u7981\u7528DNS\u53cd\u5411\u89e3\u6790&#xff08;\u52a0\u5feb\u8fde\u63a5\u901f\u5ea6&#xff09;<br \/>\nUseDNS no<\/p>\n<p># \u9650\u5236\u534f\u8bae\u7248\u672c&#xff08;\u7981\u7528\u4e0d\u5b89\u5168\u7684SSHv1&#xff09;<br \/>\nProtocol 2<\/p>\n<p># \u9650\u5236\u540c\u65f6\u4f1a\u8bdd\u6570<br \/>\nMaxSessions 5<\/p>\n<p># \u7981\u7528X11\u8f6c\u53d1&#xff08;\u9664\u975e\u9700\u8981&#xff09;<br \/>\nX11Forwarding no<\/p>\n<h4>3. \u91cd\u542f\u670d\u52a1\u4f7f\u914d\u7f6e\u751f\u6548<\/h4>\n<p># \u68c0\u67e5\u914d\u7f6e\u8bed\u6cd5\u662f\u5426\u6b63\u786e<br \/>\nsshd -t<br \/>\n# \u91cd\u542f\u670d\u52a1<br \/>\nsystemctl restart sshd<br \/>\n# \u67e5\u770b\u670d\u52a1\u72b6\u6001<br \/>\nsystemctl status sshd<\/p>\n<h3>\u56db\u3001\u5bc6\u94a5\u8ba4\u8bc1\u914d\u7f6e&#xff08;\u751f\u4ea7\u73af\u5883\u5fc5\u5b66&#xff09;<\/h3>\n<h4>1. \u672c\u5730\u751f\u6210\u5bc6\u94a5\u5bf9&#xff08;Mac\/Linux \u7ec8\u7aef&#xff09;<\/h4>\n<p># \u751f\u6210RSA\u5bc6\u94a5\u5bf9&#xff08;\u63a8\u83504096\u4f4d&#xff09;<br \/>\nssh-keygen -t rsa -b 4096 -C &#034;your_email&#064;example.com&#034;<br \/>\n# \u6216\u8005\u751f\u6210\u66f4\u5b89\u5168\u7684Ed25519\u5bc6\u94a5<br \/>\nssh-keygen -t ed25519 -a 100<\/p>\n<p># \u751f\u6210\u8fc7\u7a0b\u4e2d\u4f1a\u63d0\u793a&#xff1a;<br \/>\n# \u5bc6\u94a5\u4fdd\u5b58\u8def\u5f84&#xff08;\u9ed8\u8ba4~\/.ssh\/id_rsa&#xff09;<br \/>\n# \u8bbe\u7f6e\u5bc6\u94a5\u5bc6\u7801&#xff08;\u53ef\u9009\u4f46\u63a8\u8350&#xff09;<br \/>\n# \u786e\u8ba4\u5bc6\u94a5\u5bc6\u7801<\/p>\n<p># \u751f\u6210\u540e\u4f1a\u5728~\/.ssh\u76ee\u5f55\u4e0b\u4ea7\u751f&#xff1a;<br \/>\n# id_rsa&#xff08;\u79c1\u94a5&#xff0c;\u5fc5\u987b\u4fdd\u5bc6&#xff09;<br \/>\n# id_rsa.pub&#xff08;\u516c\u94a5&#xff0c;\u53ef\u516c\u5f00&#xff09;<br \/>\n# \u82e5\u6307\u5b9a\u4e86\u5176\u4ed6\u540d\u79f0&#xff0c;\u5982custom_key&#xff0c;\u5219\u751f\u6210custom_key\u548ccustom_key.pub<\/p>\n<p># \u8bbe\u7f6e\u79c1\u94a5\u6743\u9650<br \/>\nchmod 600 ~\/.ssh\/id_rsa<\/p>\n<h4>2. \u4e0a\u4f20\u516c\u94a5\u5230\u670d\u52a1\u5668<\/h4>\n<p># \u65b9\u6cd5\u4e00&#xff1a;\u4f7f\u7528ssh-copy-id\u81ea\u52a8\u4e0a\u4f20<br \/>\n# \u683c\u5f0f&#xff1a;ssh-copy-id -p \u7aef\u53e3 \u7528\u6237\u540d&#064;\u670d\u52a1\u5668IP<br \/>\nssh-copy-id -p 2222 admin&#064;192.168.1.100<br \/>\n# \u8f93\u5165\u5bc6\u7801\u540e\u81ea\u52a8\u5c06\u516c\u94a5\u6dfb\u52a0\u5230\u670d\u52a1\u5668~\/.ssh\/authorized_keys<\/p>\n<p># \u65b9\u6cd5\u4e8c&#xff1a;\u624b\u52a8\u4e0a\u4f20&#xff08;\u5f53ssh-copy-id\u4e0d\u53ef\u7528\u65f6&#xff09;<br \/>\n# 1. \u5c06\u516c\u94a5\u5185\u5bb9\u590d\u5236\u5230\u526a\u8d34\u677f<br \/>\ncat ~\/.ssh\/id_rsa.pub | pbcopy  # Mac<br \/>\ncat ~\/.ssh\/id_rsa.pub | xclip -selection clipboard  # Linux<\/p>\n<p># 2. \u767b\u5f55\u670d\u52a1\u5668&#xff0c;\u7f16\u8f91authorized_keys\u6587\u4ef6<br \/>\nmkdir -p ~\/.ssh<br \/>\nchmod 700 ~\/.ssh<br \/>\ntouch ~\/.ssh\/authorized_keys<br \/>\nchmod 600 ~\/.ssh\/authorized_keys<br \/>\nvim ~\/.ssh\/authorized_keys<br \/>\n# \u7c98\u8d34\u516c\u94a5\u5185\u5bb9\u5e76\u4fdd\u5b58<\/p>\n<h4>3. \u65e0\u5bc6\u7801\u767b\u5f55\u6d4b\u8bd5<\/h4>\n<p>ssh admin&#064;192.168.1.100 -p 2222<br \/>\n# \u82e5\u8bbe\u7f6e\u4e86\u5bc6\u94a5\u5bc6\u7801&#xff0c;\u5219\u9700\u8981\u8f93\u5165\u5bc6\u94a5\u5bc6\u7801<br \/>\n# \u65e0\u9700\u8f93\u5165\u670d\u52a1\u5668\u7528\u6237\u5bc6\u7801\u5373\u914d\u7f6e\u6210\u529f<\/p>\n<h3>\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u89e3\u51b3\u65b9\u6848<\/h3>\n<h4>\u26a0\ufe0f \u8fde\u63a5\u88ab\u62d2\u7edd<\/h4>\n<p># 1. \u68c0\u67e5\u670d\u52a1\u5668SSH\u670d\u52a1\u662f\u5426\u542f\u52a8<br \/>\nsystemctl status sshd<\/p>\n<p># 2. \u68c0\u67e5\u9632\u706b\u5899\u662f\u5426\u653e\u884c\u7aef\u53e3<br \/>\nfirewall-cmd &#8211;list-all<br \/>\n# \u6216\u8005<br \/>\niptables -L -n<\/p>\n<p># \u653e\u884c\u7aef\u53e3\u793a\u4f8b&#xff08;\u4ee52222\u4e3a\u4f8b&#xff09;<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-port&#061;2222\/tcp<br \/>\nfirewall-cmd &#8211;reload<\/p>\n<p># 3. \u68c0\u67e5SELinux\u662f\u5426\u963b\u6b62SSH<br \/>\nsestatus<br \/>\n# \u4e34\u65f6\u5173\u95edSELinux&#xff08;\u6d4b\u8bd5\u7528&#xff09;<br \/>\nsetenforce 0<br \/>\n# \u6c38\u4e45\u5173\u95ed&#xff08;\u4e0d\u63a8\u8350\u751f\u4ea7\u73af\u5883&#xff09;<br \/>\nvim \/etc\/selinux\/config<br \/>\n# \u4fee\u6539SELINUX&#061;disabled<\/p>\n<p># 4. \u68c0\u67e5\u7f51\u7edc\u8fde\u901a\u6027<br \/>\nping 192.168.1.100<br \/>\ntraceroute 192.168.1.100<br \/>\ntelnet 192.168.1.100 2222<\/p>\n<p># 5. \u68c0\u67e5\u7aef\u53e3\u662f\u5426\u76d1\u542c<br \/>\nnetstat -tulnp | grep ssh<br \/>\nss -tulnp | grep ssh<\/p>\n<h4>\u26a0\ufe0f \u5bc6\u7801\u767b\u5f55\u5931\u8d25<\/h4>\n<p># 1. \u68c0\u67e5sshd_config\u914d\u7f6e<br \/>\ngrep PasswordAuthentication \/etc\/ssh\/sshd_config<\/p>\n<p># 2. \u68c0\u67e5\u7528\u6237\u5bc6\u7801\u662f\u5426\u6b63\u786e<br \/>\npasswd admin<\/p>\n<p># 3. \u68c0\u67e5PAM\u6a21\u5757\u9650\u5236<br \/>\nvim \/etc\/pam.d\/sshd<\/p>\n<p># 4. \u68c0\u67e5\u7528\u6237shell\u662f\u5426\u88ab\u7981\u7528<br \/>\nvim \/etc\/passwd<br \/>\n# \u786e\u4fdd\u7528\u6237shell\u4e3a\/bin\/bash\u6216\/bin\/sh<\/p>\n<p># 5. \u68c0\u67e5\u7528\u6237\u662f\u5426\u88ab\u9501\u5b9a<br \/>\npasswd -S admin<\/p>\n<p># 6. \u67e5\u770b\u8be6\u7ec6\u65e5\u5fd7<br \/>\njournalctl -xe<br \/>\ntail -f \/var\/log\/secure<\/p>\n<h3>\u516d\u3001\u8fdb\u9636\u5b89\u5168\u8bbe\u7f6e&#xff08;\u8fd0\u7ef4\u5fc5\u770b&#xff09;<\/h3>\n<h4>\u9650\u5236 IP \u8bbf\u95ee&#xff08;\u901a\u8fc7\u9632\u706b\u5899\u53ea\u5141\u8bb8\u7279\u5b9a IP \u8fde\u63a5&#xff09;<\/h4>\n<p># \u4f7f\u7528firewalld\u9650\u5236IP\u8bbf\u95ee<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-rich-rule&#061;&#034;rule family&#061;&#039;ipv4&#039; source address&#061;&#039;192.168.1.10&#039; port protocol&#061;&#039;tcp&#039; port&#061;&#039;2222&#039; accept&#034;<br \/>\nfirewall-cmd &#8211;permanent &#8211;add-rich-rule&#061;&#034;rule family&#061;&#039;ipv4&#039; source address&#061;&#039;10.0.0.0\/24&#039; port protocol&#061;&#039;tcp&#039; port&#061;&#039;2222&#039; accept&#034;<br \/>\nfirewall-cmd &#8211;permanent &#8211;remove-service&#061;ssh<br \/>\nfirewall-cmd &#8211;reload<\/p>\n<p># \u6216\u8005\u4f7f\u7528iptables<br \/>\niptables -A INPUT -p tcp &#8211;dport 2222 -s 192.168.1.10 -j ACCEPT<br \/>\niptables -A INPUT -p tcp &#8211;dport 2222 -j DROP<br \/>\nservice iptables save<\/p>\n<h4>\u542f\u7528 TCP Wrappers&#xff08;\u66f4\u7cbe\u7ec6\u7684\u8bbf\u95ee\u63a7\u5236&#xff09;<\/h4>\n<p># \u5728\/etc\/hosts.allow\u6dfb\u52a0\u5141\u8bb8\u7684IP<br \/>\necho &#034;sshd: 192.168.1.0\/24&#034; &gt;&gt; \/etc\/hosts.allow<br \/>\necho &#034;sshd: 10.0.0.5&#034; &gt;&gt; \/etc\/hosts.allow<\/p>\n<p># \u5728\/etc\/hosts.deny\u6dfb\u52a0\u62d2\u7edd\u7684IP<br \/>\necho &#034;sshd: ALL&#034; &gt;&gt; \/etc\/hosts.deny<\/p>\n<p># \u68c0\u67e5\u914d\u7f6e\u662f\u5426\u751f\u6548<br \/>\ntcpdchk<\/p>\n<h4>\u8bbe\u7f6e\u767b\u5f55\u5931\u8d25\u9501\u5b9a&#xff08;\u9632\u66b4\u529b\u7834\u89e3&#xff09;<\/h4>\n<p># \u5b89\u88c5fail2ban<br \/>\nyum install epel-release -y<br \/>\nyum install fail2ban -y<br \/>\nsystemctl start fail2ban<br \/>\nsystemctl enable fail2ban<\/p>\n<p># \u914d\u7f6efail2ban<br \/>\nvim \/etc\/fail2ban\/jail.local<\/p>\n<p>\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9&#xff1a;<\/p>\n<p>[sshd]<br \/>\nenabled &#061; true<br \/>\nport &#061; 2222<br \/>\nfilter &#061; sshd<br \/>\nlogpath &#061; \/var\/log\/secure<br \/>\nmaxretry &#061; 3<br \/>\nfindtime &#061; 300<br \/>\nbantime &#061; 3600<br \/>\nignoreip &#061; 127.0.0.1 192.168.1.0\/24<\/p>\n<p>\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p>systemctl restart fail2ban<br \/>\n# \u67e5\u770b\u88abban\u7684IP<br \/>\nfail2ban-client status sshd<\/p>\n<h3>&#x1f4a1; \u65b0\u624b\u907f\u5751\u6307\u5357<\/h3>\n<li>\n<p>\u914d\u7f6e\u524d\u5148\u5907\u4efd&#xff1a;<\/p>\n<p> cp \/etc\/ssh\/sshd_config \/etc\/ssh\/sshd_config.bak<\/p>\n<\/li>\n<li>\n<p>\u751f\u4ea7\u73af\u5883\u5b89\u5168\u89c4\u8303&#xff1a;<\/p>\n<ul>\n<li>\u4e25\u7981\u4f7f\u7528 root &#043; \u5bc6\u7801\u767b\u5f55<\/li>\n<li>\u5bc6\u94a5\u8ba4\u8bc1 &#043; \u666e\u901a\u7528\u6237 sudo \u662f\u6807\u914d<\/li>\n<li>\u5b9a\u671f\u66f4\u65b0 SSH \u8f6f\u4ef6\u7248\u672c&#xff1a;yum update openssh-server<\/li>\n<li>\u7981\u7528\u4e0d\u5b89\u5168\u7684\u52a0\u5bc6\u7b97\u6cd5&#xff08;\u5728sshd_config\u4e2d\u6dfb\u52a0&#xff09; Ciphers chacha20-poly1305&#064;openssh.com,aes256-gcm&#064;openssh.com,aes128-gcm&#064;openssh.com,aes256-ctr,aes192-ctr,aes128-ctr<br \/>\nMACs hmac-sha2-512-etm&#064;openssh.com,hmac-sha2-256-etm&#064;openssh.com,umac-128-etm&#064;openssh.com<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u7aef\u53e3\u4fee\u6539\u6ce8\u610f\u4e8b\u9879&#xff1a;<\/p>\n<ul>\n<li>\u5148\u786e\u8ba4\u65b0\u7aef\u53e3\u80fd\u8fde\u63a5&#xff0c;\u518d\u5173\u95ed\u65e7\u7aef\u53e3<\/li>\n<li>\u4fee\u6539\u540e\u7acb\u5373\u6d4b\u8bd5&#xff1a;ssh -p \u65b0\u7aef\u53e3 \u7528\u6237\u540d&#064;IP<\/li>\n<li>\u786e\u4fdd\u9632\u706b\u5899\u548cSELinux\u5141\u8bb8\u65b0\u7aef\u53e3<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5bc6\u94a5\u7ba1\u7406&#xff1a;<\/p>\n<ul>\n<li>\u79c1\u94a5\u5fc5\u987b\u8bbe\u7f6e600\u6743\u9650&#xff1a;chmod 600 ~\/.ssh\/id_rsa<\/li>\n<li>\u5b9a\u671f\u8f6e\u6362\u5bc6\u94a5\u5bf9&#xff08;\u5efa\u8bae\u6bcf3-6\u4e2a\u6708&#xff09;<\/li>\n<li>\u4f7f\u7528\u5bc6\u94a5\u5bc6\u7801\u589e\u52a0\u5b89\u5168\u6027<\/li>\n<li>\u5907\u4efd\u5bc6\u94a5\u5bf9\u5230\u5b89\u5168\u4f4d\u7f6e<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5176\u4ed6\u5efa\u8bae&#xff1a;<\/p>\n<ul>\n<li>\u542f\u7528\u53cc\u56e0\u7d20\u8ba4\u8bc1&#xff08;\u5982Google Authenticator&#xff09;<\/li>\n<li>\u5b9a\u671f\u68c0\u67e5\u767b\u5f55\u65e5\u5fd7&#xff1a;last \u548c lastb<\/li>\n<li>\u914d\u7f6eSSH\u4f1a\u8bdd\u8d85\u65f6&#xff1a;TMOUT&#061;300&#xff08;\u6dfb\u52a0\u5230\/etc\/profile&#xff09;<\/li>\n<\/ul>\n<\/li>\n<h3>&#x1f4da; \u5b9e\u7528\u547d\u4ee4\u901f\u67e5\u8868<\/h3>\n<table>\n<tr>\u64cd\u4f5c\u573a\u666f\u547d\u4ee4\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>\u67e5\u770b SSH \u72b6\u6001<\/td>\n<td>systemctl status sshd<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u542f SSH \u670d\u52a1<\/td>\n<td>systemctl restart sshd<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b SSH \u65e5\u5fd7<\/td>\n<td>tail -f \/var\/log\/secure \u6216 journalctl -u sshd<\/td>\n<\/tr>\n<tr>\n<td>\u751f\u6210\u5bc6\u94a5\u5bf9<\/td>\n<td>ssh-keygen -t rsa -b 4096<\/td>\n<\/tr>\n<tr>\n<td>\u4e0a\u4f20\u516c\u94a5<\/td>\n<td>ssh-copy-id -p 2222 user&#064;server<\/td>\n<\/tr>\n<tr>\n<td>\u6d4b\u8bd5\u5bc6\u94a5\u767b\u5f55<\/td>\n<td>ssh -p 2222 -i ~\/.ssh\/id_rsa user&#064;server<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237<\/td>\n<td>who \u6216 w<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770b\u767b\u5f55\u5386\u53f2<\/td>\n<td>last \u548c lastb<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770bSSH\u8fde\u63a5<\/td>\n<td>&#096;netstat -tnpa<\/td>\n<\/tr>\n<tr>\n<td>\u68c0\u67e5SSH\u914d\u7f6e<\/td>\n<td>sshd -t<\/td>\n<\/tr>\n<tr>\n<td>\u67e5\u770bSSH\u7248\u672c<\/td>\n<td>ssh -V<\/td>\n<\/tr>\n<tr>\n<td>\u5f3a\u5236\u65ad\u5f00SSH\u4f1a\u8bdd<\/td>\n<td>pkill -9 -t pts\/0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u638c\u63e1\u8fd9\u4e9b\u6280\u80fd\u540e&#xff0c;\u518d\u4e5f\u4e0d\u7528\u6015\u670d\u52a1\u5668\u8fdc\u7a0b\u7ba1\u7406\u5566&#xff01;\u8bb0\u5f97\u6536\u85cf\u8fd9\u7bc7\u6559\u7a0b&#xff0c;\u914d\u7f6e\u65f6\u9047\u5230\u95ee\u9898\u53ef\u4ee5\u968f\u65f6\u5bf9\u7167&#xff5e; \u4f60\u4eec\u5728\u914d\u7f6e SSH \u65f6\u9047\u5230\u8fc7\u54ea\u4e9b\u5947\u8469\u95ee\u9898&#xff1f;\u8bc4\u8bba\u533a\u4e00\u8d77\u4ea4\u6d41\u5440&#xff5e;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e33\u6b21\uff0c\u6536\u85cf18\u6b21\u3002\u672c\u6587\u63d0\u4f9b\u4ece\u5165\u95e8\u5230\u8fdb\u9636\u7684CentOS\u670d\u52a1\u5668SSH\u914d\u7f6e\u5168\u6d41\u7a0b\uff0c\u5305\u542b\uff1a1\ufe0f\u20e3SSH\u670d\u52a1\u5b89\u88c5\u4e0e\u542f\u52a8\uff08yum\u5b89\u88c5+systemctl\u7ba1\u7406\uff09\uff1b2\ufe0f\u20e3Windows\/Mac\u8fde\u63a5\u65b9\u6cd5\uff08PuTTY\/\u7ec8\u7aef\u547d\u4ee4\uff09\uff1b3\ufe0f\u20e3\u5173\u952e\u5b89\u5168\u914d\u7f6e\uff08\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u3001\u7981\u7528root\u767b\u5f55\u3001\u5bc6\u94a5\u8ba4\u8bc1\uff09\uff1b4\ufe0f\u20e3\u5e38\u89c1\u6545\u969c\u6392\u67e5\uff08\u8fde\u63a5\u62d2\u7edd\/\u767b\u5f55\u5931\u8d25\uff09\uff1b5\ufe0f\u20e3\u8fdb\u9636\u9632\u62a4\uff08IP\u9650\u5236\u3001fail2ban\u9632\u66b4\u7834\uff09\u3002\u7279\u522b\u5f3a\u8c03\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u4f7f\u7528\u5bc6\u94a5\u8ba4\u8bc1\uff0c\u5e76\u7ed9\u51fa\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u793a\u4f8b\u3001\u5bc6\u94a5\u751f\u6210\u547d\u4ee4\u53ca\u6743\u9650\u8bbe\u7f6e\u8981\u70b9\u3002\u9644\u5b9e\u7528\u547d\u4ee4\u901f\u67e5\u8868\u548c\u65e5\u5fd7\u67e5\u770b\u6280\u5de7\uff0c\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u5feb\u901f\u638c\u63e1\u5b89\u5168\u8fdc\u7a0b\u7ba1\u7406\u3002_centos ssh<\/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":[59,77,43,44],"topic":[],"class_list":["post-47700","post","type-post","status-publish","format-standard","hentry","category-server","tag-centos","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>CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \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\/47700.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e33\u6b21\uff0c\u6536\u85cf18\u6b21\u3002\u672c\u6587\u63d0\u4f9b\u4ece\u5165\u95e8\u5230\u8fdb\u9636\u7684CentOS\u670d\u52a1\u5668SSH\u914d\u7f6e\u5168\u6d41\u7a0b\uff0c\u5305\u542b\uff1a1\ufe0f\u20e3SSH\u670d\u52a1\u5b89\u88c5\u4e0e\u542f\u52a8\uff08yum\u5b89\u88c5+systemctl\u7ba1\u7406\uff09\uff1b2\ufe0f\u20e3Windows\/Mac\u8fde\u63a5\u65b9\u6cd5\uff08PuTTY\/\u7ec8\u7aef\u547d\u4ee4\uff09\uff1b3\ufe0f\u20e3\u5173\u952e\u5b89\u5168\u914d\u7f6e\uff08\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u3001\u7981\u7528root\u767b\u5f55\u3001\u5bc6\u94a5\u8ba4\u8bc1\uff09\uff1b4\ufe0f\u20e3\u5e38\u89c1\u6545\u969c\u6392\u67e5\uff08\u8fde\u63a5\u62d2\u7edd\/\u767b\u5f55\u5931\u8d25\uff09\uff1b5\ufe0f\u20e3\u8fdb\u9636\u9632\u62a4\uff08IP\u9650\u5236\u3001fail2ban\u9632\u66b4\u7834\uff09\u3002\u7279\u522b\u5f3a\u8c03\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u4f7f\u7528\u5bc6\u94a5\u8ba4\u8bc1\uff0c\u5e76\u7ed9\u51fa\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u793a\u4f8b\u3001\u5bc6\u94a5\u751f\u6210\u547d\u4ee4\u53ca\u6743\u9650\u8bbe\u7f6e\u8981\u70b9\u3002\u9644\u5b9e\u7528\u547d\u4ee4\u901f\u67e5\u8868\u548c\u65e5\u5fd7\u67e5\u770b\u6280\u5de7\uff0c\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u5feb\u901f\u638c\u63e1\u5b89\u5168\u8fdc\u7a0b\u7ba1\u7406\u3002_centos ssh\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/47700.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-07-30T00:51:49+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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/47700.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/47700.html\",\"name\":\"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-07-30T00:51:49+00:00\",\"dateModified\":\"2025-07-30T00:51:49+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/47700.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/47700.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/47700.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357\"}]},{\"@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":"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \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\/47700.html","og_locale":"zh_CN","og_type":"article","og_title":"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.6k\u6b21\uff0c\u70b9\u8d5e33\u6b21\uff0c\u6536\u85cf18\u6b21\u3002\u672c\u6587\u63d0\u4f9b\u4ece\u5165\u95e8\u5230\u8fdb\u9636\u7684CentOS\u670d\u52a1\u5668SSH\u914d\u7f6e\u5168\u6d41\u7a0b\uff0c\u5305\u542b\uff1a1\ufe0f\u20e3SSH\u670d\u52a1\u5b89\u88c5\u4e0e\u542f\u52a8\uff08yum\u5b89\u88c5+systemctl\u7ba1\u7406\uff09\uff1b2\ufe0f\u20e3Windows\/Mac\u8fde\u63a5\u65b9\u6cd5\uff08PuTTY\/\u7ec8\u7aef\u547d\u4ee4\uff09\uff1b3\ufe0f\u20e3\u5173\u952e\u5b89\u5168\u914d\u7f6e\uff08\u4fee\u6539\u9ed8\u8ba4\u7aef\u53e3\u3001\u7981\u7528root\u767b\u5f55\u3001\u5bc6\u94a5\u8ba4\u8bc1\uff09\uff1b4\ufe0f\u20e3\u5e38\u89c1\u6545\u969c\u6392\u67e5\uff08\u8fde\u63a5\u62d2\u7edd\/\u767b\u5f55\u5931\u8d25\uff09\uff1b5\ufe0f\u20e3\u8fdb\u9636\u9632\u62a4\uff08IP\u9650\u5236\u3001fail2ban\u9632\u66b4\u7834\uff09\u3002\u7279\u522b\u5f3a\u8c03\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u4f7f\u7528\u5bc6\u94a5\u8ba4\u8bc1\uff0c\u5e76\u7ed9\u51fa\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u793a\u4f8b\u3001\u5bc6\u94a5\u751f\u6210\u547d\u4ee4\u53ca\u6743\u9650\u8bbe\u7f6e\u8981\u70b9\u3002\u9644\u5b9e\u7528\u547d\u4ee4\u901f\u67e5\u8868\u548c\u65e5\u5fd7\u67e5\u770b\u6280\u5de7\uff0c\u9002\u5408\u8fd0\u7ef4\u65b0\u624b\u5feb\u901f\u638c\u63e1\u5b89\u5168\u8fdc\u7a0b\u7ba1\u7406\u3002_centos ssh","og_url":"https:\/\/www.wsisp.com\/helps\/47700.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-07-30T00:51:49+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/47700.html","url":"https:\/\/www.wsisp.com\/helps\/47700.html","name":"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-07-30T00:51:49+00:00","dateModified":"2025-07-30T00:51:49+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/47700.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/47700.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/47700.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"CentOS\u670d\u52a1\u5668SSH\u8fdc\u7a0b\u8fde\u63a5\u5168\u6307\u5357"}]},{"@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\/47700","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=47700"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/47700\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=47700"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=47700"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=47700"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=47700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}