{"id":181460,"date":"2021-01-26T19:15:26","date_gmt":"2021-01-26T11:15:26","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=181460"},"modified":"2023-06-20T15:31:15","modified_gmt":"2023-06-20T07:31:15","slug":"basic-learning-09","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/basic-learning-09.html","title":{"rendered":"\u7b2c9\u7ae0 \u4f7f\u7528ssh\u670d\u52a1\u7ba1\u7406\u8fdc\u7a0b\u4e3b\u673a"},"content":{"rendered":"

\u7ae0\u8282\u7b80\u8ff0\uff1a\u00a0<\/strong><\/span><\/p>\n

\u672c\u7ae0\u8bb2\u89e3\u4e86\u5982\u4f55\u4f7f\u7528nmtui\u547d\u4ee4\u914d\u7f6e\u7f51\u5361\u53c2\u6570\uff0c\u4ee5\u53ca\u901a\u8fc7nmcli\u547d\u4ee4\u67e5\u770b\u7f51\u7edc\u4fe1\u606f\u5e76\u7ba1\u7406\u7f51\u7edc\u4f1a\u8bdd\u670d\u52a1\uff0c\u4ece\u800c\u8ba9\u8bfb\u8005\u80fd\u591f\u5728\u4e0d\u540c\u5de5\u4f5c\u573a\u666f\u4e2d\u5feb\u901f\u5730\u5207\u6362\u7f51\u7edc\u8fd0\u884c\u53c2\u6570\uff1b\u8fd8\u8bb2\u89e3\u4e86\u5982\u4f55\u624b\u5de5\u7ed1\u5b9around-robin\uff08\u8f6e\u8be2\uff09\u6a21\u5f0f\u53cc\u7f51\u5361\uff0c\u5b9e\u73b0\u7f51\u7edc\u7684\u8d1f\u8f7d\u5747\u8861\u3002<\/p>\n

\u672c\u7ae0\u6df1\u5165\u4ecb\u7ecd\u4e86SSH\u534f\u8bae\u4e0esshd\u670d\u52a1\u7a0b\u5e8f\u7684\u7406\u8bba\u77e5\u8bc6\u3001Linux\u7cfb\u7edf\u7684\u8fdc\u7a0b\u7ba1\u7406\u65b9\u6cd5\u4ee5\u53ca\u5728\u7cfb\u7edf\u4e2d\u914d\u7f6e\u670d\u52a1\u7a0b\u5e8f\u7684\u65b9\u6cd5\uff0c\u5e76\u91c7\u7528\u5b9e\u9a8c\u7684\u5f62\u5f0f\u6f14\u793a\u4e86\u4f7f\u7528\u57fa\u4e8e\u5bc6\u7801\u4e0e\u5bc6\u94a5\u9a8c\u8bc1\u7684sshd\u670d\u52a1\u7a0b\u5e8f\u8fdb\u884c\u8fdc\u7a0b\u8bbf\u95ee\uff0c\u4ee5\u53ca\u4f7f\u7528Tmux\u670d\u52a1\u7a0b\u5e8f\u8fdc\u7a0b\u7ba1\u7406Linux\u7cfb\u7edf\u7684\u4e0d\u95f4\u65ad\u4f1a\u8bdd\u7b49\u6280\u672f\u3002\u672c\u7ae0\u8be6\u7ec6\u8bb2\u89e3\u4e86\u65e5\u5fd7\u7cfb\u7edf\u7684\u7406\u8bba\u77e5\u8bc6\uff0c\u5e76\u4f7f\u7528journalctl\u547d\u4ee4\u57fa\u4e8e\u5404\u79cd\u6761\u4ef6\u8fdb\u884c\u65e5\u5fd7\u4fe1\u606f\u7684\u68c0\u7d22\uff0c\u4ee5\u5feb\u901f\u5b9a\u4f4d\u5de5\u4f5c\u4e2d\u7684\u6545\u969c\u70b9\u3002<\/p>\n

\u5f53\u8bfb\u8005\u638c\u63e1\u4e86\u672c\u7ae0\u7684\u5185\u5bb9\u4e4b\u540e\uff0c\u4e5f\u5c31\u5b8c\u5168\u5177\u5907\u4e86\u5bf9Linux\u7cfb\u7edf\u8fdb\u884c\u914d\u7f6e\u7ba1\u7406\u7684\u77e5\u8bc6\u3002\u800c\u4e14\u540e\u7eed\u7ae0\u8282\u4e2d\u5c06\u9646\u7eed\u5f15\u5165\u5927\u91cf\u5b9e\u7528\u670d\u52a1\u7684\u914d\u7f6e\u5185\u5bb9\uff0c\u8bfb\u8005\u5c06\u4f1a\u4f7f\u7528\u672c\u7ae0\u5b66\u4e60\u7684\u77e5\u8bc6\u8fdb\u884c\u914d\u7f6e\u3002\u8fd9\u6837\u4e00\u65b9\u9762\u80fd\u591f\u8ba9\u8bfb\u8005\u5bf9\u751f\u4ea7\u73af\u5883\u4e2d\u7528\u5230\u7684\u5927\u591a\u6570\u70ed\u95e8\u670d\u52a1\u7a0b\u5e8f\u6709\u4e00\u4e2a\u5e7f\u6cdb\u4e14\u6df1\u5165\u7684\u8ba4\u8bc6\uff0c\u53e6\u4e00\u65b9\u9762\u4e5f\u53ef\u4ee5\u638c\u63e1\u76f8\u5e94\u7684\u914d\u7f6e\u65b9\u6cd5\u3002<\/p>\n

9.1 \u914d\u7f6e\u7f51\u5361\u670d\u52a1<\/strong><\/span><\/h5>\n
9.1.1 \u914d\u7f6e\u7f51\u5361\u53c2\u6570<\/strong><\/span><\/h6>\n

\u622a\u81f3\u76ee\u524d\uff0c\u5927\u5bb6\u5df2\u7ecf\u5b8c\u5168\u53ef\u4ee5\u5229\u7528\u5f53\u524d\u6240\u5b66\u7684\u77e5\u8bc6\u6765\u7ba1\u7406Linux\u7cfb\u7edf\u4e86\u3002\u5f53\u7136\uff0c\u5927\u5bb6\u7684\u6c34\u5e73\u5b8c\u5168\u53ef\u4ee5\u66f4\u8fdb\u4e00\u6b65\uff0c\u5f53\u6709\u671d\u4e00\u65e5\u767b\u9876\u6280\u672f\u5dc5\u5cf0\u65f6\uff0c\u60a8\u4e00\u5b9a\u4f1a\u611f\u8c22\u73b0\u5728\u6b63\u5728\u52aa\u529b\u5b66\u4e60\u7684\u81ea\u5df1\u3002<\/p>\n

\u6211\u4eec\u63a5\u4e0b\u6765\u5c06\u5b66\u4e60\u5982\u4f55\u5728Linux\u7cfb\u7edf\u4e0a\u914d\u7f6e\u670d\u52a1\u3002\u4f46\u662f\u5728\u6b64\u4e4b\u524d\uff0c\u5fc5\u987b\u5148\u4fdd\u8bc1\u4e3b\u673a\u4e4b\u95f4\u80fd\u591f\u987a\u7545\u5730\u901a\u4fe1\u3002\u5982\u679c\u7f51\u7edc\u4e0d\u901a\uff0c\u5373\u4fbf\u670d\u52a1\u90e8\u7f72\u5f97\u518d\u6b63\u786e\uff0c\u7528\u6237\u4e5f\u65e0\u6cd5\u987a\u5229\u8bbf\u95ee\u3002\u6240\u4ee5\uff0c\u914d\u7f6e\u7f51\u7edc\u5e76\u786e\u4fdd\u7f51\u7edc\u7684\u8fde\u901a\u6027\u662f\u5b66\u4e60\u90e8\u7f72Linux\u670d\u52a1\u4e4b\u524d\u6700\u540e\u4e00\u4e2a\u91cd\u8981\u7684\u77e5\u8bc6\u70b9\u3002<\/p>\n

4.1.3\u8282\u8bb2\u89e3\u4e86\u5982\u4f55\u4f7f\u7528Vim\u6587\u672c\u7f16\u8f91\u5668\u6765\u914d\u7f6e\u7f51\u5361\u53c2\u6570\u3002\u5176\u5b9e\uff0c\u5728RHEL 8\u7cfb\u7edf\u4e2d\u81f3\u5c11\u67095\u79cd\u7f51\u7edc\u7684\u914d\u7f6e\u65b9\u6cd5\uff0c\u5218\u9044\u8001\u5e08\u5c3d\u91cf\u5728\u672c\u4e66\u4e2d\u4e3a\u5927\u5bb6\u9010\u4e00\u6f14\u793a\u3002\u8fd9\u91cc\u6559\u7ed9\u5927\u5bb6\u7684\u662f\u4f7f\u7528nmtui\u547d\u4ee4\u6765\u914d\u7f6e\u7f51\u7edc\uff0c\u5176\u5177\u4f53\u7684\u914d\u7f6e\u6b65\u9aa4\u5982\u56fe9-1\u81f3\u56fe9-8\u6240\u793a\u3002\u5f53\u9047\u5230\u4e0d\u5bb9\u6613\u7406\u89e3\u7684\u5185\u5bb9\u65f6\uff0c\u4f1a\u989d\u5916\u8fdb\u884c\u89e3\u91ca\u8bf4\u660e\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-1\u00a0 \u6267\u884cnmtui\u547d\u4ee4\u8fd0\u884c\u7f51\u7edc\u914d\u7f6e\u5de5\u5177<\/p>\n

\"\"<\/p>\n

\u56fe9-2\u00a0 \u9009\u4e2d\u914d\u7f6e\u7f51\u5361\u6309\u94ae\u5e76\u6309\u4e0b\u56de\u8f66\u952e<\/p>\n

\u5728RHEL 5\u3001RHEL 6\u7cfb\u7edf\u53ca\u5176\u4ed6\u5927\u591a\u6570\u65e9\u671f\u7684Linux\u7cfb\u7edf\u4e2d\uff0c\u7f51\u5361\u7684\u540d\u79f0\u4e00\u76f4\u90fd\u662feth0\u3001eth1\u3001eth2\u3001\u2026\u2026\uff1b\u5728RHEL 7\u4e2d\u5219\u53d8\u6210\u4e86\u7c7b\u4f3c\u4e8eeno16777736\u8fd9\u6837\u7684\u540d\u5b57\uff1b\u800c\u5728RHEL 8\u7cfb\u7edf\u4e2d\u7f51\u5361\u7684\u6700\u65b0\u540d\u79f0\u662f\u7c7b\u4f3c\u4e8eens160\u3001ens192\u8fd9\u6837\u7684\uff0c\u6240\u4ee5\u7ecf\u9a8c\u4e30\u5bcc\u7684\u8fd0\u7ef4\u8001\u624b\u5149\u770b\u7f51\u5361\u540d\u79f0\u5927\u81f4\u5c31\u80fd\u731c\u51fa\u7cfb\u7edf\u7684\u7248\u672c\u4e86\u3002\u4e0d\u8fc7\u9664\u4e86\u7f51\u5361\u7684\u540d\u79f0\u53d1\u751f\u53d8\u5316\u4e4b\u5916\uff0c\u5176\u4ed6\u4e00\u5207\u51e0\u4e4e\u7167\u65e7\uff0c\u56e0\u6b64\u8fd9\u91cc\u6f14\u793a\u7684\u7f51\u7edc\u914d\u7f6e\u5b9e\u9a8c\u5b8c\u5168\u53ef\u4ee5\u9002\u7528\u4e8e\u5404\u79cd\u7248\u672c\u7684Linux\u7cfb\u7edf\u3002<\/p>\n

\u73b0\u5728\uff0c\u5728\u670d\u52a1\u5668\u4e3b\u673a\u7684\u7f51\u7edc\u914d\u7f6e\u4fe1\u606f\u4e2d\u586b\u5199IP\u5730\u5740192.168.10.10\/24\u300224\u8868\u793a\u5b50\u7f51\u63a9\u7801\u4e2d\u7684\u524d24\u4f4d\u4e3a\u7f51\u7edc\u53f7\uff0c\u540e8\u4f4d\u662f\u4e3b\u673a\u53f7\uff08\u4e0e\u5199\u6210255.255.255.0\u7684\u6548\u679c\u4e00\u6837\uff09\u3002\u7f51\u5173\u3001DNS\u7b49\u4fe1\u606f\u6682\u53ef\u4e0d\u5fc5\u586b\u5199\uff0c\u7b49\u7528\u5230\u65f6\u518d\u8865\u5145\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-3\u00a0 \u9009\u4e2d\u8981\u914d\u7f6e\u7684\u7f51\u5361\u540d\u79f0\uff0c\u7136\u540e\u6309\u4e0b\u7f16\u8f91\u6309\u94ae<\/p>\n

\"\"<\/p>\n

\u56fe9-4\u00a0 \u628a\u7f51\u5361IPv4\u7684\u914d\u7f6e\u65b9\u5f0f\u6539\u6210\u624b\u52a8\u6a21\u5f0f<\/p>\n

\"\"<\/p>\n

\u56fe9-5\u00a0 \u6309\u4e0b\u663e\u793a\u8be6\u7ec6\u4fe1\u606f\u6309\u94ae<\/p>\n

\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\n

\u518d\u591a\u63d0\u4e00\u53e5\uff0c\u54b1\u4eec\u8fd9\u672c\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\uff08\u7b2c2\u7248\uff09\u300b\u4e0d\u4ec5\u5b66\u4e60\u95e8\u69db\u4f4e\u3001\u7b80\u5355\u6613\u61c2\uff0c\u800c\u4e14\u8fd8\u6709\u4e00\u4e2a\u6f5c\u5728\u7684\u4f18\u52bf\u2014\u4e66\u4e2d\u6240\u6709\u7684\u670d\u52a1\u5668\u4e3b\u673aIP\u5730\u5740\u5747\u4e3a192.168.10.10\uff0c\u800c\u5ba2\u6237\u7aef\u4e3b\u673a\u5747\u4e3a192.168.10.20\u53ca192.168.10.30\u3002\u8fd9\u6837\u7684\u597d\u5904\u5c31\u662f\uff0c\u5728\u540e\u9762\u90e8\u7f72Linux\u670d\u52a1\u7684\u65f6\u5019\uff0c\u4e0d\u7528\u6bcf\u6b21\u90fd\u8981\u8003\u8651IP\u5730\u5740\u53d8\u5316\u7684\u95ee\u9898\uff0c\u4ece\u800c\u53ef\u4ee5\u5fc3\u65e0\u65c1\u9a9b\u5730\u5173\u6ce8\u914d\u7f6e\u7ec6\u8282\u3002<\/p>\n<\/div>\n<\/div>\n

\"\"<\/p>\n

\u56fe9-6\u00a0 \u586b\u5199IP\u5730\u5740\u548c\u5b50\u7f51\u63a9\u7801<\/p>\n

\"\"<\/p>\n

\u56fe9-7\u00a0 \u5355\u51fbOK\u6309\u94ae\u4fdd\u5b58\u914d\u7f6e<\/p>\n

\"\"<\/p>\n

\u56fe9-8\u00a0 \u5355\u51fbBack\u6309\u94ae\u7ed3\u675f\u914d\u7f6e\u5de5\u4f5c<\/p>\n

\u81f3\u6b64\uff0c\u5728Linux\u7cfb\u7edf\u4e2d\u914d\u7f6e\u7f51\u7edc\u7684\u6b65\u9aa4\u5c31\u7ed3\u675f\u4e86\u3002<\/p>\n

\u5218\u9044\u8001\u5e08\u5728\u57f9\u8bad\u65f6\u4f1a\u7ecf\u5e38\u53d1\u73b0\uff0c\u5f88\u591a\u5b66\u5458\u5728\u5b89\u88c5RHEL 8\u7cfb\u7edf\u65f6\u9ed8\u8ba4\u6ca1\u6709\u6fc0\u6d3b\u7f51\u5361\u3002\u5982\u679c\u5404\u4f4d\u8bfb\u8005\u6709\u540c\u6837\u7684\u60c5\u51b5\u4e5f\u4e0d\u7528\u62c5\u5fc3\uff0c\u53ea\u9700\u4f7f\u7528Vim\u7f16\u8f91\u5668\u5c06\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684ONBOOT\u53c2\u6570\u4fee\u6539\u6210yes\uff0c\u8fd9\u6837\u5728\u7cfb\u7edf\u91cd\u542f\u540e\u7f51\u5361\u5c31\u88ab\u6fc0\u6d3b\u4e86\u3002<\/p>\n

[root@linuxprobe ~]# vim \/etc\/sysconfig\/network-scripts\/ifcfg-ens160\r\nTYPE=Ethernet\r\nPROXY_METHOD=none\r\nBROWSER_ONLY=no\r\nBOOTPROTO=none\r\nDEFROUTE=yes\r\nIPV4_FAILURE_FATAL=no\r\nIPV6INIT=yes\r\nIPV6_AUTOCONF=yes\r\nIPV6_DEFROUTE=yes\r\nIPV6_FAILURE_FATAL=no\r\nIPV6_ADDR_GEN_MODE=stable-privacy\r\nNAME=ens160\r\nUUID=97486c86-6d1e-4e99-9aa2-68d3172098b2\r\nDEVICE=ens160\r\nONBOOT=yes<\/strong>\r\nHWADDR=00:0C:29:7D:27:BF\r\nIPADDR=192.168.10.10\r\nPREFIX=24\r\nIPV6_PRIVACY=no\r\n<\/pre>\n

\u5f53\u4fee\u6539\u5b8cLinux\u7cfb\u7edf\u4e2d\u7684\u670d\u52a1\u914d\u7f6e\u6587\u4ef6\u540e\uff0c\u5e76\u4e0d\u4f1a\u5bf9\u670d\u52a1\u7a0b\u5e8f\u7acb\u5373\u4ea7\u751f\u6548\u679c\u3002\u8981\u60f3\u8ba9\u670d\u52a1\u7a0b\u5e8f\u83b7\u53d6\u5230\u6700\u65b0\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u9700\u8981\u624b\u52a8\u91cd\u542f\u76f8\u5e94\u7684\u670d\u52a1\uff0c\u4e4b\u540e\u5c31\u53ef\u4ee5\u770b\u5230\u7f51\u7edc\u7545\u901a\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection reload ens160\r\n[root@linuxprobe ~]# nmcli connection up ens160\r\nConnection successfully activated (D-Bus active path: \/org\/freedesktop\/NetworkManager\/ActiveConnection\/6)\r\n[root@linuxprobe ~]# ping 192.168.10.10\r\nPING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.\r\n64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.122 ms\r\n64 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.048 ms\r\n64 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.106 ms\r\n64 bytes from 192.168.10.10: icmp_seq=4 ttl=64 time=0.043 ms\r\n\r\n--- 192.168.10.10 ping statistics ---\r\n4 packets transmitted, 4 received, 0% packet loss, time 61ms\r\nrtt min\/avg\/max\/mdev = 0.043\/0.079\/0.122\/0.036 ms\r\n<\/pre>\n
9.1.2 \u521b\u5efa\u7f51\u7edc\u4f1a\u8bdd<\/strong><\/span><\/h6>\n

RHEL\u548cCentOS\u7cfb\u7edf\u9ed8\u8ba4\u4f7f\u7528NetworkManager\u6765\u63d0\u4f9b\u7f51\u7edc\u670d\u52a1\uff0c\u8fd9\u662f\u4e00\u79cd\u52a8\u6001\u7ba1\u7406\u7f51\u7edc\u914d\u7f6e\u7684\u5b88\u62a4\u8fdb\u7a0b\uff0c\u80fd\u591f\u8ba9\u7f51\u7edc\u8bbe\u5907\u4fdd\u6301\u8fde\u63a5\u72b6\u6001\u3002\u53ef\u4ee5\u4f7f\u7528nmcli\u547d\u4ee4\u6765\u7ba1\u7406NetworkManager\u670d\u52a1\u7a0b\u5e8f\u3002nmcli\u662f\u4e00\u6b3e\u57fa\u4e8e\u547d\u4ee4\u884c\u7684\u7f51\u7edc\u914d\u7f6e\u5de5\u5177\uff0c\u529f\u80fd\u4e30\u5bcc\uff0c\u53c2\u6570\u4f17\u591a\u3002\u5b83\u53ef\u4ee5\u8f7b\u677e\u5730\u67e5\u770b\u7f51\u7edc\u4fe1\u606f\u6216\u7f51\u7edc\u72b6\u6001\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection show\r\nNAME    UUID                                  TYPE      DEVICE \r\nens160  97486c86-6d1e-4e99-9aa2-68d3172098b2  ethernet  ens160 \r\nvirbr0  e5fca1ee-7020-4c21-a65b-259d0f993b44  bridge    virbr0\r\n[root@linuxprobe ~]# nmcli connection show ens160 \r\nconnection.id:                          ens160\r\nconnection.uuid:                        97486c86-6d1e-4e99-9aa2-68d3172098b2\r\nconnection.stable-id:                   --\r\nconnection.type:                        802-3-ethernet\r\nconnection.interface-name:              ens160\r\nconnection.autoconnect:                 yes\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u53e6\u5916\uff0cRHEL 8\u7cfb\u7edf\u652f\u6301\u7f51\u7edc\u4f1a\u8bdd\u529f\u80fd\uff0c\u5141\u8bb8\u7528\u6237\u5728\u591a\u4e2a\u914d\u7f6e\u6587\u4ef6\u4e2d\u5feb\u901f\u5207\u6362\uff08\u975e\u5e38\u7c7b\u4f3c\u4e8efirewalld\u9632\u706b\u5899\u670d\u52a1\u4e2d\u7684\u533a\u57df\u6280\u672f\uff09\u3002\u5982\u679c\u6211\u4eec\u5728\u516c\u53f8\u7f51\u7edc\u4e2d\u4f7f\u7528\u7b14\u8bb0\u672c\u7535\u8111\u65f6\u9700\u8981\u624b\u52a8\u6307\u5b9a\u7f51\u7edc\u7684IP\u5730\u5740\uff0c\u800c\u56de\u5230\u5bb6\u4e2d\u5219\u662f\u4f7f\u7528DHCP\u81ea\u52a8\u5206\u914dIP\u5730\u5740\uff0c\u8fd9\u5c31\u9700\u8981\u9ebb\u70e6\u5730\u9891\u7e41\u4fee\u6539IP\u5730\u5740\uff0c\u4f46\u662f\u4f7f\u7528\u4e86\u7f51\u7edc\u4f1a\u8bdd\u529f\u80fd\u540e\u4e00\u5207\u5c31\u7b80\u5355\u591a\u4e86\u2014\u53ea\u9700\u5728\u4e0d\u540c\u7684\u4f7f\u7528\u73af\u5883\u4e2d\u6fc0\u6d3b\u76f8\u5e94\u7684\u7f51\u7edc\u4f1a\u8bdd\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u7f51\u7edc\u914d\u7f6e\u4fe1\u606f\u7684\u81ea\u52a8\u5207\u6362\u4e86\u3002<\/p>\n

\u4f7f\u7528nmcli\u547d\u4ee4\u5e76\u6309\u7167\u201cconnection add con-name type ifname\u201d\u7684\u683c\u5f0f\u6765\u521b\u5efa\u7f51\u7edc\u4f1a\u8bdd\u3002\u5047\u8bbe\u5c06\u516c\u53f8\u7f51\u7edc\u4e2d\u7684\u7f51\u7edc\u4f1a\u8bdd\u79f0\u4e4b\u4e3acompany\uff0c\u5c06\u5bb6\u5ead\u7f51\u7edc\u4e2d\u7684\u7f51\u7edc\u4f1a\u8bdd\u79f0\u4e4b\u4e3ahouse\uff0c\u73b0\u5728\u4f9d\u6b21\u521b\u5efa\u5404\u81ea\u7684\u7f51\u7edc\u4f1a\u8bdd\u3002<\/p>\n

\u4f7f\u7528con-name\u53c2\u6570\u6307\u5b9a\u516c\u53f8\u6240\u4f7f\u7528\u7684\u7f51\u7edc\u4f1a\u8bdd\u540d\u79f0company\uff0c\u7136\u540e\u4f9d\u6b21\u7528ifname\u53c2\u6570\u6307\u5b9a\u672c\u673a\u7684\u7f51\u5361\u540d\u79f0\uff08\u5343\u4e07\u8981\u4ee5\u5b9e\u9645\u73af\u5883\u4e3a\u51c6\uff0c\u4e0d\u8981\u7167\u6284\u4e66\u4e0a\u7684ens160\uff09\uff0c\u7528autoconnect no\u53c2\u6570\u5c06\u7f51\u7edc\u4f1a\u8bdd\u8bbe\u7f6e\u4e3a\u9ed8\u8ba4\u4e0d\u88ab\u81ea\u52a8\u6fc0\u6d3b\uff0c\u4ee5\u53ca\u7528ip4\u53cagw4\u53c2\u6570\u624b\u52a8\u6307\u5b9a\u7f51\u7edc\u7684IP\u5730\u5740\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection add con-name company ifname ens160 autoconnect no type ethernet ip4 192.168.10.10\/24 gw4 192.168.10.1\r\nConnection 'company' (6ac8f3ad-0846-42f4-819a-e1ae84f4da86) successfully added.<\/pre>\n

\u4f7f\u7528con-name\u53c2\u6570\u6307\u5b9a\u5bb6\u5ead\u6240\u4f7f\u7528\u7684\u7f51\u7edc\u4f1a\u8bdd\u540d\u79f0house\u3002\u56e0\u4e3a\u8981\u4ece\u5916\u90e8DHCP\u670d\u52a1\u5668\u81ea\u52a8\u83b7\u5f97IP\u5730\u5740\uff0c\u6240\u4ee5\u8fd9\u91cc\u4e0d\u9700\u8981\u8fdb\u884c\u624b\u52a8\u6307\u5b9a\u3002<\/p>\n

[root@linuxprobe ~]# nmcli connection add con-name house type ethernet ifname ens160\r\nConnection 'house' (d848242a-4bdf-4446-9079-6e12ab5d1f15) successfully added.\r\n<\/pre>\n

\u5728\u6210\u529f\u521b\u5efa\u7f51\u7edc\u4f1a\u8bdd\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528nmcli\u547d\u4ee4\u67e5\u770b\u521b\u5efa\u7684\u6240\u6709\u7f51\u7edc\u4f1a\u8bdd\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection show\r\nNAME     UUID                                  TYPE      DEVICE \r\nens160   97486c86-6d1e-4e99-9aa2-68d3172098b2  ethernet  ens160 \r\nvirbr0   e5fca1ee-7020-4c21-a65b-259d0f993b44  bridge    virbr0 <\/strong>\r\ncompany  6ac8f3ad-0846-42f4-819a-e1ae84f4da86  ethernet  --     \r\nhouse    d848242a-4bdf-4446-9079-6e12ab5d1f15  ethernet  --  \r\n<\/pre>\n

\u4f7f\u7528nmcli\u547d\u4ee4\u914d\u7f6e\u8fc7\u7684\u7f51\u7edc\u4f1a\u8bdd\u662f\u6c38\u4e45\u751f\u6548\u7684\uff0c\u8fd9\u6837\u5f53\u6211\u4eec\u4e0a\u73ed\u540e\uff0c\u987a\u624b\u542f\u52a8company\u7f51\u7edc\u4f1a\u8bdd\uff0c\u7f51\u5361\u4fe1\u606f\u5c31\u81ea\u52a8\u914d\u7f6e\u597d\u4e86\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection up company \r\nConnection successfully activated (D-Bus active path: \/org\/freedesktop\/NetworkManager\/ActiveConnection\/6)\r\n[root@linuxprobe ~]# ifconfig\r\nens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500\r\n        inet 192.168.10.88 <\/strong> netmask 255.255.255.0  broadcast 192.168.10.255\r\n        inet6 fe80::320e:a005:dfa1:431c  prefixlen 64  scopeid 0x20\r\n        ether 00:0c:29:7d:27:bf  txqueuelen 1000  (Ethernet)\r\n        RX packets 66  bytes 5469 (5.3 KiB)\r\n        RX errors 0  dropped 0  overruns 0  frame 0\r\n        TX packets 99  bytes 11255 (10.9 KiB)\r\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u5982\u679c\u5927\u5bb6\u4f7f\u7528\u7684\u662f\u865a\u62df\u673a\uff0c\u8bf7\u628a\u865a\u62df\u673a\u7cfb\u7edf\u7684\u7f51\u5361\uff08\u7f51\u7edc\u9002\u914d\u5668\uff09\u5207\u6362\u6210\u6865\u63a5\u6a21\u5f0f\uff0c\u5982\u56fe9-9\u6240\u793a\u3002\u7136\u540e\u91cd\u542f\u865a\u62df\u673a\u7cfb\u7edf\u5373\u53ef\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-9\u00a0 \u8bbe\u7f6e\u865a\u62df\u673a\u7f51\u5361\u7684\u6a21\u5f0f<\/p>\n

\u8fd9\u6837\u64cd\u4f5c\u8fc7\u540e\u5c31\u80fd\u4f7f\u7528\u5bb6\u5ead\u4e2d\u7684\u8def\u7531\u5668\u8bbe\u5907\u4e86\u3002\u542f\u52a8house\u5bb6\u5ead\u4f1a\u8bdd\uff0c\u770b\u4e00\u4e0b\u6548\u679c\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection up house\r\nConnection successfully activated (D-Bus active path: \/org\/freedesktop\/NetworkManager\/ActiveConnection\/4)\r\n[root@linuxprobe ~]# ifconfig\r\nens160: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500\r\n        inet 192.168.0.107<\/strong>  netmask 255.255.255.0  broadcast 192.168.0.255\r\n        inet6 fe80::f209:dc47:4004:3868  prefixlen 64  scopeid 0x20\r\n        ether 00:0c:29:7d:27:bf  txqueuelen 1000  (Ethernet)\r\n        RX packets 22  bytes 6924 (6.7 KiB)\r\n        RX errors 0  dropped 0  overruns 0  frame 0\r\n        TX packets 82  bytes 10582 (10.3 KiB)\r\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u5982\u679c\u542f\u7528company\u4f1a\u8bdd\u6210\u529f\uff0c\u4f46\u542f\u7528house\u4f1a\u8bdd\u5931\u8d25\u4e14\u4e0d\u80fd\u83b7\u53d6\u5230\u52a8\u6001\u5730\u5740\uff0c\u5219\u8bc1\u660e\u60a8\u7684\u914d\u7f6e\u662f\u6b63\u786e\u7684\uff0c\u95ee\u9898\u51fa\u5728\u4e86\u5916\u90e8\u7f51\u7edc\u73af\u5883\u3002\u67093\u79cd\u5e38\u89c1\u7684\u60c5\u51b5\uff0c\u9996\u5148\uff0c\u60a8\u5bb6\u4e2d\u7684\u8bbe\u5907\u6ca1\u6709\u8fde\u63a5\u8def\u7531\u5668\uff0c\u800c\u662f\u901a\u8fc7\u62e8\u53f7\u7f51\u7edc\u6216\u5171\u4eabWiFi\u7684\u65b9\u5f0f\u4e0a\u7f51\uff1b\u5176\u6b21\uff0c\u8fd8\u5728\u4e0a\u5b66\u6216\u4e0a\u73ed\u7684\u8bfb\u8005\u5728\u6d4f\u89c8\u7f51\u9875\u524d\u5fc5\u987b\u901a\u8fc7\u5b66\u6821\u6216\u516c\u53f8\u7684\u9a8c\u8bc1\u9875\u9762\u624d\u80fd\u8bbf\u95ee\u4e92\u8054\u7f51\uff1b\u6700\u540e\uff0c\u68c0\u67e5\u7269\u7406\u673a\u7684\u9632\u706b\u5899\u8bbe\u7f6e\uff0c\u53ef\u6682\u65f6\u5173\u95ed\u540e\u518d\u91cd\u8bd5\u3002<\/p>\n

\u540e\u7eed\u4e0d\u9700\u8981\u7f51\u7edc\u4f1a\u8bdd\u65f6\uff0c\u76f4\u63a5\u7528delete\u547d\u4ee4\u5c31\u80fd\u5220\u9664\uff0c\u7279\u522b\u7b80\u5355\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection delete house\r\nConnection 'house' (d848242a-4bdf-4446-9079-6e12ab5d1f15) successfully deleted.\r\n[root@linuxprobe ~]# nmcli connection delete company \r\nConnection 'company' (6ac8f3ad-0846-42f4-819a-e1ae84f4da86) successfully deleted.\r\n<\/pre>\n
9.1.3 \u7ed1\u5b9a\u4e24\u5757\u7f51\u5361<\/span><\/strong><\/h6>\n

\u4e00\u822c\u6765\u8bb2\uff0c\u751f\u4ea7\u73af\u5883\u5fc5\u987b\u63d0\u4f9b7\u00d724\u5c0f\u65f6\u7684\u7f51\u7edc\u4f20\u8f93\u670d\u52a1\u3002\u501f\u52a9\u4e8e\u7f51\u5361\u7ed1\u5b9a\u6280\u672f\uff0c\u4e0d\u4ec5\u80fd\u591f\u63d0\u9ad8\u7f51\u7edc\u4f20\u8f93\u901f\u5ea6\uff0c\u66f4\u91cd\u8981\u7684\u662f\uff0c\u8fd8\u53ef\u4ee5\u786e\u4fdd\u5728\u5176\u4e2d\u4e00\u5757\u7f51\u5361\u51fa\u73b0\u6545\u969c\u65f6\uff0c\u4f9d\u7136\u53ef\u4ee5\u6b63\u5e38\u63d0\u4f9b\u7f51\u7edc\u670d\u52a1\u3002\u5047\u8bbe\u6211\u4eec\u5bf9\u4e24\u5757\u7f51\u5361\u5b9e\u65bd\u4e86\u7ed1\u5b9a\u6280\u672f\uff0c\u8fd9\u6837\u5728\u6b63\u5e38\u5de5\u4f5c\u4e2d\u5b83\u4eec\u4f1a\u5171\u540c\u4f20\u8f93\u6570\u636e\uff0c\u4f7f\u5f97\u7f51\u7edc\u4f20\u8f93\u7684\u901f\u5ea6\u53d8\u5f97\u66f4\u5feb\uff1b\u800c\u4e14\u5373\u4f7f\u6709\u4e00\u5757\u7f51\u5361\u7a81\u7136\u51fa\u73b0\u4e86\u6545\u969c\uff0c\u53e6\u5916\u4e00\u5757\u7f51\u5361\u4fbf\u4f1a\u7acb\u5373\u81ea\u52a8\u9876\u66ff\u4e0a\u53bb\uff0c\u4fdd\u8bc1\u6570\u636e\u4f20\u8f93\u4e0d\u4f1a\u4e2d\u65ad\u3002<\/p>\n

\u4e0b\u9762\u6765\u770b\u4e00\u4e0b\u5982\u4f55\u7ed1\u5b9a\u7f51\u5361\u3002<\/p>\n

\u5728\u865a\u62df\u673a\u7cfb\u7edf\u4e2d\u518d\u6dfb\u52a0\u4e00\u5757\u7f51\u5361\u8bbe\u5907\uff0c\u8bf7\u786e\u4fdd\u4e24\u5757\u7f51\u5361\u90fd\u5904\u5728\u540c\u4e00\u79cd\u7f51\u7edc\u8fde\u63a5\u6a21\u5f0f\u4e2d\uff0c\u5982\u56fe9-10\u548c\u56fe9-11\u6240\u793a\u3002\u5904\u4e8e\u76f8\u540c\u6a21\u5f0f\u7684\u7f51\u5361\u8bbe\u5907\u624d\u53ef\u4ee5\u8fdb\u884c\u7f51\u5361\u7ed1\u5b9a\uff0c\u5426\u5219\u8fd9\u4e24\u5757\u7f51\u5361\u65e0\u6cd5\u4e92\u76f8\u4f20\u9001\u6570\u636e\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-10\u00a0 \u5728\u865a\u62df\u673a\u4e2d\u518d\u6dfb\u52a0\u4e00\u5757\u7f51\u5361\u8bbe\u5907<\/p>\n

\"\"<\/p>\n

\u56fe9-11\u00a0 \u786e\u4fdd\u4e24\u5757\u7f51\u5361\u5904\u5728\u540c\u4e00\u4e2a\u7f51\u7edc\u8fde\u63a5\u4e2d\uff08\u5373\u7f51\u5361\u6a21\u5f0f\u76f8\u540c\uff09<\/p>\n

\u524d\u9762\u662f\u4f7f\u7528nmtui\u547d\u4ee4\u6765\u914d\u7f6e\u7f51\u7edc\u4fe1\u606f\uff0c\u8fd9\u6b21\u6211\u4eec\u4f7f\u7528nmcli\u547d\u4ee4\u6765\u914d\u7f6e\u7f51\u5361\u8bbe\u5907\u7684\u7ed1\u5b9a\u53c2\u6570\u3002\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u5927\u5bb6\u540c\u65f6\u5b66\u5230\u4e24\u4e2a\u547d\u4ee4\uff0c\u800c\u4e0d\u7528\u4f9d\u8d56\u4e8e\u67d0\u4e2a\u7279\u5b9a\u7684\u547d\u4ee4\u4e86\u3002\u7f51\u5361\u7ed1\u5b9a\u7684\u7406\u8bba\u77e5\u8bc6\u7c7b\u4f3c\u4e8e\u524d\u9762\u5b66\u4e60\u7684RAID\u786c\u76d8\u7ec4\uff0c\u6211\u4eec\u9700\u8981\u5bf9\u53c2\u4e0e\u7ed1\u5b9a\u7684\u7f51\u5361\u8bbe\u5907\u9010\u4e2a\u8fdb\u884c\u201c\u521d\u59cb\u8bbe\u7f6e\u201d\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5982\u56fe9-12\u6240\u793a\uff0c\u5de6\u4fa7\u7684ens160\u53caens192\u8fd9\u4e9b\u539f\u672c\u72ec\u7acb\u7684\u7f51\u5361\u8bbe\u5907\u6b64\u65f6\u9700\u8981\u88ab\u914d\u7f6e\u6210\u4e3a\u4e00\u5757\u201c\u4ece\u5c5e\u201d\u7f51\u5361\uff0c\u670d\u52a1\u4e8e\u53f3\u4fa7\u7684bond0\u201c\u4e3b\u201d\u7f51\u5361\uff0c\u4e0d\u5e94\u8be5\u518d\u6709\u81ea\u5df1\u7684IP\u5730\u5740\u7b49\u4fe1\u606f\u3002\u5728\u8fdb\u884c\u4e86\u521d\u59cb\u8bbe\u7f6e\u4e4b\u540e\uff0c\u5b83\u4eec\u5c31\u53ef\u4ee5\u652f\u6301\u7f51\u5361\u7ed1\u5b9a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-12 \u7f51\u5361\u7ed1\u5b9a\u4fe1\u606f\u793a\u610f\u56fe<\/p>\n

1\uff0e\u521b\u5efa\u51fa\u4e00\u4e2abond\u7f51\u5361<\/strong><\/p>\n

\n

\u4f7f\u7528nmcli\u547d\u4ee4\u914d\u7f6e\u7f51\u7edc\u4fe1\u606f\u6709\u4e00\u5b9a\u7684\u96be\u5ea6\uff0c\u6240\u4ee5\u54b1\u4eec\u653e\u5230\u4e86\u7b2c9\u7ae0\u624d\u5f00\u59cb\u8bb2\u89e3\u3002\u9996\u5148\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2abond\u7f51\u5361\u3002\u5176\u4e2d\uff0c\u547d\u4ee4\u4e0e\u53c2\u6570\u7684\u610f\u601d\u662f\u521b\u5efa\u4e00\u4e2a\u7c7b\u578b\u4e3abond\uff08\u7ed1\u5b9a\uff09\u3001\u540d\u79f0\u4e3abond0\u3001\u7f51\u5361\u540d\u4e3abond0\u7684\u7ed1\u5b9a\u8bbe\u5907\uff0c\u7ed1\u5b9a\u6a21\u5f0f\u4e3abalance-rr\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection add type bond con-name bond0 ifname bond0 bond.options \"mode=balance-rr\"\r\nConnection 'bond0' (b37b720d-c5fa-43f8-8578-820d19811f32) successfully added.<\/pre>\n

\u8fd9\u91cc\u4f7f\u7528\u7684\u662fbalance-rr\u7f51\u5361\u7ed1\u5b9a\u6a21\u5f0f\uff0c\u5176\u4e2drr\u662fround-robin\u7684\u7f29\u5199\uff0c\u5168\u79f0\u4e3a\u8f6e\u5faa\u6a21\u5f0f\u3002round-robin\u7684\u7279\u70b9\u662f\u4f1a\u6839\u636e\u8bbe\u5907\u987a\u5e8f\u4f9d\u6b21\u4f20\u8f93\u6570\u636e\u5305\uff0c\u63d0\u4f9b\u8d1f\u8f7d\u5747\u8861\u7684\u6548\u679c\uff0c\u8ba9\u5e26\u5bbd\u7684\u6027\u80fd\u66f4\u597d\u4e00\u4e9b\uff1b\u800c\u4e14\u4e00\u65e6\u67d0\u4e2a\u7f51\u5361\u53d1\u751f\u6545\u969c\uff0c\u4f1a\u9a6c\u4e0a\u5207\u6362\u5230\u53e6\u5916\u4e00\u53f0\u7f51\u5361\u8bbe\u5907\u4e0a\uff0c\u4fdd\u8bc1\u7f51\u7edc\u4f20\u8f93\u4e0d\u88ab\u4e2d\u65ad\u3002active-backup\u662f\u53e6\u5916\u4e00\u79cd\u6bd4\u8f83\u5e38\u7528\u7684\u7f51\u5361\u7ed1\u5b9a\u6a21\u5f0f\uff0c\u5b83\u7684\u7279\u70b9\u662f\u5e73\u65f6\u53ea\u6709\u4e00\u5757\u7f51\u5361\u6b63\u5e38\u5de5\u4f5c\uff0c\u53e6\u4e00\u4e2a\u7f51\u5361\u968f\u65f6\u5f85\u547d\uff0c\u4e00\u65e6\u5de5\u4f5c\u4e2d\u7684\u7f51\u5361\u53d1\u751f\u635f\u574f\uff0c\u5f85\u547d\u7684\u7f51\u5361\u4f1a\u81ea\u52a8\u9876\u66ff\u4e0a\u53bb\u3002\u53ef\u89c1\uff0c\u8fd9\u79cd\u7f51\u5361\u7ed1\u5b9a\u6a21\u5f0f\u7684\u5197\u4f59\u80fd\u529b\u6bd4\u8f83\u5f3a\uff0c\u56e0\u6b64\u4e5f\u79f0\u4e3a\u4e3b\u5907\u6a21\u5f0f\u3002<\/p>\n

\u6bd4\u5982\uff0c\u6709\u4e00\u53f0\u7528\u4e8e\u63d0\u4f9bNFS\u6216\u8005Samba\u670d\u52a1\u7684\u6587\u4ef6\u670d\u52a1\u5668\uff0c\u5b83\u6240\u80fd\u63d0\u4f9b\u7684\u6700\u5927\u7f51\u7edc\u4f20\u8f93\u901f\u5ea6\u4e3a100Mbit\/s\uff0c\u4f46\u662f\u8bbf\u95ee\u8be5\u670d\u52a1\u5668\u7684\u7528\u6237\u6570\u91cf\u7279\u522b\u591a\uff0c\u56e0\u6b64\u5b83\u7684\u8bbf\u95ee\u538b\u529b\u4e5f\u5f88\u5927\u3002\u5728\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u7f51\u7edc\u7684\u53ef\u9760\u6027\u662f\u6781\u4e3a\u91cd\u8981\u7684\uff0c\u800c\u4e14\u7f51\u7edc\u7684\u4f20\u8f93\u901f\u5ea6\u4e5f\u5fc5\u987b\u5f97\u4ee5\u4fdd\u8bc1\u3002\u9488\u5bf9\u8fd9\u6837\u7684\u60c5\u51b5\uff0c\u6bd4\u8f83\u597d\u7684\u9009\u62e9\u5c31\u662f\u4f7f\u7528balance-rr\u7f51\u5361\u7ed1\u5b9a\u6a21\u5f0f\u4e86\u3002\u56e0\u4e3abalance-rr\u6a21\u5f0f\u80fd\u591f\u8ba9\u4e24\u5757\u7f51\u5361\u540c\u65f6\u4e00\u8d77\u5de5\u4f5c\uff0c\u5f53\u5176\u4e2d\u4e00\u5757\u7f51\u5361\u51fa\u73b0\u6545\u969c\u540e\u80fd\u81ea\u52a8\u5907\u63f4\uff0c\u4e14\u65e0\u987b\u4ea4\u6362\u673a\u8bbe\u5907\u652f\u63f4\uff0c\u4ece\u800c\u63d0\u4f9b\u4e86\u53ef\u9760\u7684\u7f51\u7edc\u4f20\u8f93\u4fdd\u969c\u3002<\/p>\n<\/div>\n

2\uff0e\u5411bond0\u6dfb\u52a0\u4ece\u5c5e\u7f51\u5361<\/strong><\/p>\n

\u521a\u624d\u521b\u5efa\u6210\u529f\u7684bond0\u8bbe\u5907\u5f53\u524d\u4ec5\u4ec5\u662f\u4e2a\u540d\u79f0\uff0c\u91cc\u9762\u5e76\u6ca1\u6709\u771f\u6b63\u80fd\u4e3a\u7528\u6237\u4f20\u8f93\u6570\u636e\u7684\u7f51\u5361\u8bbe\u5907\uff0c\u63a5\u4e0b\u6765\u4f7f\u7528\u4e0b\u9762\u7684\u547d\u4ee4\u628aens160\u548cens192\u7f51\u5361\u6dfb\u52a0\u8fdb\u6765\u3002\u5176\u4e2d\uff0ccon-name\u53c2\u6570\u540e\u9762\u63a5\u7684\u662f\u4ece\u5c5e\u7f51\u5361\u7684\u540d\u79f0\uff08\u53ef\u4ee5\u968f\u65f6\u8bbe\u7f6e\uff09\uff1bifname\u53c2\u6570\u540e\u9762\u63a5\u7684\u662f\u4e24\u5757\u7f51\u5361\u7684\u540d\u79f0\u3002\u5927\u5bb6\u4e00\u5b9a\u8981\u4ee5\u771f\u5b9e\u7684\u7f51\u5361\u540d\u79f0\u4e3a\u51c6\uff0c\u4e0d\u8981\u76f4\u63a5\u590d\u5236\u8fd9\u91cc\u7684\u540d\u5b57\uff1a<\/p>\n

\n
[root@linuxprobe ~]# nmcli connection add type ethernet slave-type bond con-name bond0-port1 ifname ens160 master bond0\r\nConnection 'bond0-port1' (8a2f77ee-cc92-4c11-9292-d577ccf8753d) successfully added.\r\n[root@linuxprobe ~]# nmcli connection add type ethernet slave-type bond con-name bond0-port2 ifname ens192 master bond0\r\nConnection 'bond0-port2' (b1ca9c47-3051-480a-9623-fbe4bf731a89) successfully added.<\/pre>\n
\n

3\uff0e\u914d\u7f6ebond0\u8bbe\u5907\u7684\u7f51\u5361\u4fe1\u606f<\/strong><\/p>\n<\/div>\n

\u914d\u7f6e\u7f51\u7edc\u53c2\u6570\u7684\u65b9\u6cd5\u6709\u5f88\u591a\uff0c\u4e3a\u4e86\u8ba9\u8fd9\u4e2a\u5b9e\u9a8c\u7684\u914d\u7f6e\u8fc7\u7a0b\u66f4\u52a0\u5177\u6709\u4e00\u81f4\u6027\uff0c\u4e0b\u9762\u8fd8\u662f\u7528nmcli\u547d\u4ee4\u4f9d\u6b21\u914d\u7f6e\u7f51\u7edc\u7684IP\u5730\u5740\u53ca\u5b50\u7f51\u63a9\u7801\u3001\u7f51\u5173\u3001DNS\u3001\u641c\u7d22\u57df\u548c\u624b\u52a8\u914d\u7f6e\u7b49\u53c2\u6570\u3002\u5982\u679c\u540c\u5b66\u4eec\u4e0d\u4e60\u60ef\u8fd9\u4e2a\u547d\u4ee4\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7f16\u8f91\u7f51\u5361\u914d\u7f6e\u6587\u4ef6\uff0c\u6216\u4f7f\u7528nmtui\u547d\u4ee4\u5b8c\u6210\u4e0b\u9762\u7684\u64cd\u4f5c\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection modify bond0 ipv4.addresses 192.168.10.10\/24\r\n[root@linuxprobe ~]# nmcli connection modify bond0 ipv4.gateway 192.168.10.1\r\n[root@linuxprobe ~]# nmcli connection modify bond0 ipv4.dns 192.168.10.1\r\n[root@linuxprobe ~]# nmcli connection modify bond0 ipv4.dns-search lrxjmw.cn\r\n[root@linuxprobe ~]# nmcli connection modify bond0 ipv4.method manual\r\n<\/pre>\n

4\uff0e\u542f\u52a8\u5b83\uff01<\/strong><\/p>\n

\u63a5\u4e0b\u6765\u5c31\u662f\u6fc0\u52a8\u4eba\u5fc3\u7684\u65f6\u523b\u4e86\uff0c\u542f\u52a8\u5b83\u5427\uff01\u518d\u987a\u4fbf\u770b\u4e00\u4e0b\u8bbe\u5907\u7684\u8be6\u7ec6\u5217\u8868\uff1a<\/p>\n

[root@linuxprobe ~]# nmcli connection up bond0\r\nConnection successfully activated (master waiting for slaves) (D-Bus active path: \/org\/freedesktop\/NetworkManager\/ActiveConnection\/22)\r\n[root@linuxprobe ~]# nmcli device status\r\nDEVICE      TYPE      STATE      CONNECTION  \r\nbond0       bond      connected  bond0      <\/strong> \r\nens160      ethernet  connected  ens160      \r\nvirbr0      bridge    connected  virbr0      \r\nens192      ethernet  connected  bond0-port2 \r\nlo          loopback  unmanaged  --          \r\nvirbr0-nic  tun       unmanaged  --<\/pre>\n<\/div>\n

\u5f53\u7528\u6237\u63a5\u4e0b\u6765\u8bbf\u95ee\u4e3b\u673aIP\u5730\u5740192.168.10.10\u65f6\uff0c\u4e3b\u673a\u5b9e\u9645\u4e0a\u662f\u7531\u4e24\u5757\u7f51\u5361\u5728\u5171\u540c\u63d0\u4f9b\u670d\u52a1\u3002\u53ef\u4ee5\u5728\u672c\u5730\u4e3b\u673a\u6267\u884cping 192.168.10.10\u547d\u4ee4\u68c0\u67e5\u7f51\u7edc\u7684\u8fde\u901a\u6027\u3002\u4e3a\u4e86\u68c0\u9a8c\u7f51\u5361\u7ed1\u5b9a\u6280\u672f\u7684\u81ea\u52a8\u5907\u63f4\u529f\u80fd\uff0c\u53ef\u4ee5\u7a81\u7136\u5728\u865a\u62df\u673a\u786c\u4ef6\u914d\u7f6e\u4e2d\u968f\u673a\u79fb\u9664\u4e00\u5757\u7f51\u5361\u8bbe\u5907\uff0c\u5982\u56fe9-13\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-13 \u968f\u673a\u79fb\u9664\u6389\u4efb\u610f\u4e00\u5757\u7f51\u5361<\/p>\n

\u53ef\u4ee5\u975e\u5e38\u6e05\u6670\u5730\u770b\u5230\u7f51\u5361\u5207\u6362\u7684\u8fc7\u7a0b\uff08\u4e00\u822c\u53ea\u4e22\u5931\u4e00\u4e2a\u6570\u636e\u5305\uff09\uff0c\u53e6\u5916\u4e00\u5757\u7f51\u5361\u4f1a\u7ee7\u7eed\u4e3a\u7528\u6237\u63d0\u4f9b\u670d\u52a1\u3002<\/p>\n

[root@linuxprobe ~]# ping 192.168.10.10\r\nPING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.\r\n64 bytes from 192.168.10.10: icmp_seq=1 ttl=64 time=0.109 ms\r\n64 bytes from 192.168.10.10: icmp_seq=2 ttl=64 time=0.102 ms\r\n64 bytes from 192.168.10.10: icmp_seq=3 ttl=64 time=0.066 ms\r\nping: sendmsg: Network is unreachable<\/strong>\r\n64 bytes from 192.168.10.10: icmp_seq=5 ttl=64 time=0.065 ms\r\n64 bytes from 192.168.10.10: icmp_seq=6 ttl=64 time=0.048 ms\r\n64 bytes from 192.168.10.10: icmp_seq=7 ttl=64 time=0.042 ms\r\n64 bytes from 192.168.10.10: icmp_seq=8 ttl=64 time=0.079 ms\r\n^C\r\n--- 192.168.10.10 ping statistics ---\r\n8 packets transmitted, 7 received, 12% packet loss, time 7006ms\r\nrtt min\/avg\/max\/mdev = 0.042\/0.073\/0.109\/0.023 ms<\/pre>\n

\u7531\u4e8e\u5728RHEL 8\u7cfb\u7edf\u4e2d\uff0c\u7f51\u5361\u7ed1\u5b9a\u5207\u6362\u95f4\u9694\u4e3a1\u6beb\u79d2\uff08\u4e5f\u5c31\u662f1\/1000\u79d2\uff09\uff0c\u56e0\u6b64\u53d1\u751f\u4e00\u4e2a\u4e22\u5305\u7684\u60c5\u51b5\u5927\u6982\u7387\u4e0d\u4f1a\u51fa\u73b0\u3002<\/p>\n

9.2 \u8fdc\u7a0b\u63a7\u5236\u670d\u52a1<\/strong><\/span><\/h5>\n
9.2.1 \u914d\u7f6esshd\u670d\u52a1<\/strong><\/span><\/h6>\n

SSH\uff08Secure\u00a0Shell<\/a>\uff09\u662f\u4e00\u79cd\u80fd\u591f\u4ee5\u5b89\u5168\u7684\u65b9\u5f0f\u63d0\u4f9b\u8fdc\u7a0b\u767b\u5f55\u7684\u534f\u8bae\uff0c\u4e5f\u662f\u76ee\u524d\u8fdc\u7a0b\u7ba1\u7406Linux\u7cfb\u7edf\u7684\u9996\u9009\u65b9\u5f0f\u3002\u5728\u6b64\u4e4b\u524d\uff0c\u4e00\u822c\u4f7f\u7528FTP\u6216Telnet\u6765\u8fdb\u884c\u8fdc\u7a0b\u767b\u5f55\u3002\u4f46\u662f\u56e0\u4e3a\u5b83\u4eec\u4ee5\u660e\u6587\u7684\u5f62\u5f0f\u5728\u7f51\u7edc\u4e2d\u4f20\u8f93\u8d26\u6237\u5bc6\u7801\u548c\u6570\u636e\u4fe1\u606f\uff0c\u56e0\u6b64\u5f88\u4e0d\u5b89\u5168\uff0c\u5f88\u5bb9\u6613\u53d7\u5230\u9ed1\u5ba2\u53d1\u8d77\u7684\u4e2d\u95f4\u4eba\u653b\u51fb\uff0c\u8f7b\u5219\u7be1\u6539\u4f20\u8f93\u7684\u6570\u636e\u4fe1\u606f\uff0c\u91cd\u5219\u76f4\u63a5\u6293\u53d6\u670d\u52a1\u5668\u7684\u8d26\u6237\u5bc6\u7801\u3002<\/p>\n

\u60f3\u8981\u4f7f\u7528SSH\u534f\u8bae\u6765\u8fdc\u7a0b\u7ba1\u7406Linux\u7cfb\u7edf\uff0c\u5219\u9700\u8981\u914d\u7f6e\u90e8\u7f72sshd\u670d\u52a1\u7a0b\u5e8f\u3002sshd\u662f\u57fa\u4e8eSSH\u534f\u8bae\u5f00\u53d1\u7684\u4e00\u6b3e\u8fdc\u7a0b\u7ba1\u7406\u670d\u52a1\u7a0b\u5e8f\uff0c\u4e0d\u4ec5\u4f7f\u7528\u8d77\u6765\u65b9\u4fbf\u5feb\u6377\uff0c\u800c\u4e14\u80fd\u591f\u63d0\u4f9b\u4e24\u79cd\u5b89\u5168\u9a8c\u8bc1\u7684\u65b9\u6cd5\uff1a<\/p>\n

\u57fa\u4e8e\u5bc6\u7801\u7684\u9a8c\u8bc1<\/strong>\u2014\u7528\u8d26\u6237\u548c\u5bc6\u7801\u6765\u9a8c\u8bc1\u767b\u5f55\uff1b<\/p>\n

\u57fa\u4e8e\u5bc6\u94a5\u7684\u9a8c\u8bc1<\/strong>\u2014\u9700\u8981\u5728\u672c\u5730\u751f\u6210\u5bc6\u94a5\u5bf9\uff0c\u7136\u540e\u628a\u5bc6\u94a5\u5bf9\u4e2d\u7684\u516c\u94a5\u4e0a\u4f20\u81f3\u670d\u52a1\u5668\uff0c\u5e76\u4e0e\u670d\u52a1\u5668\u4e2d\u7684\u516c\u94a5\u8fdb\u884c\u6bd4\u8f83\uff1b\u8be5\u65b9\u5f0f\u76f8\u8f83\u6765\u8bf4\u66f4\u5b89\u5168\u3002<\/p><\/blockquote>\n

\u524d\u6587\u66fe\u591a\u6b21\u5f3a\u8c03\u201cLinux\u7cfb\u7edf\u4e2d\u7684\u4e00\u5207\u90fd\u662f\u6587\u4ef6\u201d\uff0c\u56e0\u6b64\u5728Linux\u7cfb\u7edf\u4e2d\u4fee\u6539\u670d\u52a1\u7a0b\u5e8f\u7684\u8fd0\u884c\u53c2\u6570\uff0c\u5b9e\u9645\u4e0a\u5c31\u662f\u5728\u4fee\u6539\u7a0b\u5e8f\u914d\u7f6e\u6587\u4ef6\u7684\u8fc7\u7a0b\u3002sshd\u670d\u52a1\u7684\u914d\u7f6e\u4fe1\u606f\u4fdd\u5b58\u5728\/etc\/ssh\/sshd_config\u6587\u4ef6\u4e2d\u3002\u8fd0\u7ef4\u4eba\u5458\u4e00\u822c\u4f1a\u628a\u4fdd\u5b58\u7740\u6700\u4e3b\u8981\u914d\u7f6e\u4fe1\u606f\u7684\u6587\u4ef6\u79f0\u4e3a\u4e3b\u914d\u7f6e\u6587\u4ef6\uff0c\u800c\u914d\u7f6e\u6587\u4ef6\u4e2d\u6709\u8bb8\u591a\u4ee5\u4e95\u53f7\uff08#\uff09\u5f00\u5934\u7684\u6ce8\u91ca\u884c\uff0c\u8981\u60f3\u8ba9\u8fd9\u4e9b\u914d\u7f6e\u53c2\u6570\u751f\u6548\uff0c\u9700\u8981\u5728\u4fee\u6539\u53c2\u6570\u540e\u518d\u53bb\u6389\u524d\u9762\u7684\u4e95\u53f7\u3002sshd\u670d\u52a1\u914d\u7f6e\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u91cd\u8981\u53c2\u6570\u5982\u88689-1\u6240\u793a\u3002<\/p>\n

\u88689-1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sshd\u670d\u52a1\u914d\u7f6e\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
Port 22<\/td>\n\u9ed8\u8ba4\u7684sshd\u670d\u52a1\u7aef\u53e3<\/td>\n<\/tr>\n
ListenAddress 0.0.0.0<\/td>\n\u8bbe\u5b9asshd\u670d\u52a1\u5668\u76d1\u542c\u7684IP\u5730\u5740<\/td>\n<\/tr>\n
Protocol 2<\/td>\nSSH\u534f\u8bae\u7684\u7248\u672c\u53f7<\/td>\n<\/tr>\n
HostKey \/tc\/ssh\/ssh_host_key<\/td>\nSSH\u534f\u8bae\u7248\u672c\u4e3a1\u65f6\uff0cDES\u79c1\u94a5\u5b58\u653e\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n
HostKey \/etc\/ssh\/ssh_host_rsa_key<\/td>\nSSH\u534f\u8bae\u7248\u672c\u4e3a2\u65f6\uff0cRSA\u79c1\u94a5\u5b58\u653e\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n
HostKey \/etc\/ssh\/ssh_host_dsa_key<\/td>\nSSH\u534f\u8bae\u7248\u672c\u4e3a2\u65f6\uff0cDSA\u79c1\u94a5\u5b58\u653e\u7684\u4f4d\u7f6e<\/td>\n<\/tr>\n
PermitRootLogin yes<\/td>\n\u8bbe\u5b9a\u662f\u5426\u5141\u8bb8root\u7ba1\u7406\u5458\u76f4\u63a5\u767b\u5f55<\/td>\n<\/tr>\n
StrictModes yes<\/td>\n\u5f53\u8fdc\u7a0b\u7528\u6237\u7684\u79c1\u94a5\u6539\u53d8\u65f6\u76f4\u63a5\u62d2\u7edd\u8fde\u63a5<\/td>\n<\/tr>\n
MaxAuthTries 6<\/td>\n\u6700\u5927\u5bc6\u7801\u5c1d\u8bd5\u6b21\u6570<\/td>\n<\/tr>\n
MaxSessions 10<\/td>\n\u6700\u5927\u7ec8\u7aef\u6570<\/td>\n<\/tr>\n
PasswordAuthentication yes<\/td>\n\u662f\u5426\u5141\u8bb8\u5bc6\u7801\u9a8c\u8bc1<\/td>\n<\/tr>\n
PermitEmptyPasswords no<\/td>\n\u662f\u5426\u5141\u8bb8\u7a7a\u5bc6\u7801\u767b\u5f55\uff08\u5f88\u4e0d\u5b89\u5168\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u4f1a\u4f7f\u7528\u4e24\u53f0\u865a\u62df\u673a\uff0c\u4e00\u53f0\u5145\u5f53\u670d\u52a1\u5668\uff0c\u53e6\u5916\u4e00\u53f0\u5145\u5f53\u5ba2\u6237\u7aef\uff0c\u5176IP\u5730\u5740\u53ca\u4f5c\u7528\u5982\u88689-2\u6240\u793a\u3002<\/p>\n

\u88689-2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sshd\u670d\u52a1\u5b9e\u9a8c\u673a\u5668\u7b80\u4ecb<\/p>\n\n\n\n\n\n
\u4e3b\u673a\u5730\u5740<\/td>\n\u64cd\u4f5c\u7cfb\u7edf<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
192.168.10.10<\/td>\nLinux<\/td>\n\u670d\u52a1\u5668<\/td>\n<\/tr>\n
192.168.10.20<\/td>\nLinux<\/td>\n\u5ba2\u6237\u7aef<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5728RHEL 8\u7cfb\u7edf\u4e2d\uff0c\u5df2\u7ecf\u9ed8\u8ba4\u5b89\u88c5\u5e76\u542f\u7528\u4e86sshd\u670d\u52a1\u7a0b\u5e8f\u3002\u63a5\u4e0b\u6765\u5728\u5ba2\u6237\u7aef\u4f7f\u7528ssh\u547d\u4ee4\u8fdc\u7a0b\u8fde\u63a5\u670d\u52a1\u5668\uff0c\u5176\u683c\u5f0f\u4e3a\u201cssh [\u53c2\u6570]\u4e3b\u673aIP\u5730\u5740\u201d\uff0c\u8981\u9000\u51fa\u767b\u5f55\u5219\u6267\u884cexit\u547d\u4ee4\u3002\u7b2c\u4e00\u6b21\u8bbf\u95ee\u65f6\u9700\u8981\u8f93\u5165yes\u6765\u786e\u8ba4\u5bf9\u65b9\u4e3b\u673a\u7684\u6307\u7eb9\u4fe1\u606f\uff1a<\/p>\n

[root@Client ~]# ssh 192.168.10.10\r\nThe authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.\r\nECDSA key fingerprint is SHA256:5d52kZi1la\/FJK4v4jibLBZhLqzGqbJAskZiME6ZXpQ.\r\nAre you sure you want to continue connecting (yes\/no)? yes<\/strong>\r\nWarning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.\r\nroot@192.168.10.10's password: \u6b64\u5904\u8f93\u5165\u670d\u52a1\u5668\u7ba1\u7406\u5458\u5bc6\u7801<\/strong>\r\nActivate the web console with: systemctl enable --now cockpit.socket\r\n\r\nLast login: Fri Jul 24 06:26:58 2020\r\n[root@Server ~]# \r\n[root@Server ~]# exit\r\nlogout\r\nConnection to 192.168.10.10 closed.\r\n<\/pre>\n

\u5982\u679c\u7981\u6b62\u4ee5root\u7ba1\u7406\u5458\u7684\u8eab\u4efd\u8fdc\u7a0b\u767b\u5f55\u5230\u670d\u52a1\u5668\uff0c\u5219\u53ef\u4ee5\u5927\u5927\u964d\u4f4e\u88ab\u9ed1\u5ba2\u66b4\u529b\u7834\u89e3\u5bc6\u7801\u7684\u6982\u7387\u3002\u4e0b\u9762\u8fdb\u884c\u76f8\u5e94\u914d\u7f6e\u3002\u9996\u5148\u4f7f\u7528Vim\u6587\u672c\u7f16\u8f91\u5668\u6253\u5f00\u670d\u52a1\u5668\u4e0a\u7684sshd\u670d\u52a1\u4e3b\u914d\u7f6e\u6587\u4ef6\uff0c\u7136\u540e\u628a\u7b2c46\u884c#PermitRootLogin yes\u53c2\u6570\u524d\u7684\u4e95\u53f7\uff08#\uff09\u53bb\u6389\uff0c\u5e76\u628a\u53c2\u6570\u503cyes\u6539\u6210no\uff0c\u8fd9\u6837\u5c31\u4e0d\u518d\u5141\u8bb8root\u7ba1\u7406\u5458\u8fdc\u7a0b\u767b\u5f55\u4e86\u3002\u8bb0\u5f97\u6700\u540e\u4fdd\u5b58\u6587\u4ef6\u5e76\u9000\u51fa\u3002<\/p>\n

[root@Server ~]# vim \/etc\/ssh\/sshd_config \r\n \u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n 43 # Authentication:\r\n 44 \r\n 45 #LoginGraceTime 2m\r\n 46 PermitRootLogin no<\/strong>\r\n 47 #StrictModes yes\r\n 48 #MaxAuthTries 6\r\n 49 #MaxSessions 10\r\n \u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u518d\u6b21\u63d0\u9192\u7684\u662f\uff0c\u4e00\u822c\u7684\u670d\u52a1\u7a0b\u5e8f\u5e76\u4e0d\u4f1a\u5728\u914d\u7f6e\u6587\u4ef6\u4fee\u6539\u4e4b\u540e\u7acb\u5373\u83b7\u5f97\u6700\u65b0\u7684\u53c2\u6570\u3002\u5982\u679c\u60f3\u8ba9\u65b0\u914d\u7f6e\u6587\u4ef6\u751f\u6548\uff0c\u5219\u9700\u8981\u624b\u52a8\u91cd\u542f\u76f8\u5e94\u7684\u670d\u52a1\u7a0b\u5e8f\u3002\u6700\u597d\u4e5f\u5c06\u8fd9\u4e2a\u670d\u52a1\u7a0b\u5e8f\u52a0\u5165\u5230\u5f00\u673a\u542f\u52a8\u9879\u4e2d\uff0c\u8fd9\u6837\u7cfb\u7edf\u5728\u4e0b\u4e00\u6b21\u542f\u52a8\u65f6\uff0c\u8be5\u670d\u52a1\u7a0b\u5e8f\u4fbf\u4f1a\u81ea\u52a8\u8fd0\u884c\uff0c\u7ee7\u7eed\u4e3a\u7528\u6237\u63d0\u4f9b\u670d\u52a1\u3002<\/p>\n

[root@Server ~]# systemctl restart sshd\r\n[root@Server ~]# systemctl enable sshd<\/pre>\n

\u8fd9\u6837\u4e00\u6765\uff0c\u5f53root\u7ba1\u7406\u5458\u518d\u6765\u5c1d\u8bd5\u8bbf\u95eesshd\u670d\u52a1\u7a0b\u5e8f\u65f6\uff0c\u7cfb\u7edf\u4f1a\u63d0\u793a\u201c\u4e0d\u53ef\u8bbf\u95ee\u201d\u7684\u9519\u8bef\u4fe1\u606f\u3002\u867d\u7136sshd\u670d\u52a1\u7a0b\u5e8f\u7684\u53c2\u6570\u76f8\u5bf9\u6bd4\u8f83\u7b80\u5355\uff0c\u4f46\u8fd9\u5c31\u662f\u5728Linux\u7cfb\u7edf\u4e2d\u914d\u7f6e\u670d\u52a1\u7a0b\u5e8f\u7684\u6b63\u786e\u65b9\u6cd5\u3002\u5927\u5bb6\u8981\u505a\u7684\u662f\u4e3e\u4e00\u53cd\u4e09\u3001\u6d3b\u5b66\u6d3b\u7528\uff0c\u8fd9\u6837\u5373\u4fbf\u4ee5\u540e\u9047\u5230\u4e86\u964c\u751f\u7684\u670d\u52a1\uff0c\u4e5f\u4e00\u6837\u53ef\u4ee5\u641e\u5b9a\u4e86\u3002<\/p>\n

[root@Client ~]# ssh 192.168.10.10\r\nroot@192.168.10.10's password:\u6b64\u5904\u8f93\u5165\u670d\u52a1\u5668\u7ba1\u7406\u5458\u5bc6\u7801<\/strong>\r\nPermission denied, please try again.<\/pre>\n

\u4e3a\u4e86\u907f\u514d\u540e\u7eed\u5b9e\u9a8c\u4e2d\u4e0d\u80fd\u7528root\u7ba1\u7406\u5458\u8d26\u53f7\u767b\u5f55\uff0c\u8bf7\u5927\u5bb6\u52a8\u624b\u628a\u4e0a\u9762\u7684\u53c2\u6570\u4fee\u6539\u00a0 \u56de\u6765\uff1a<\/p>\n

[root@Server ~]# vim \/etc\/ssh\/sshd_config \r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026 \r\n 43 # Authentication:\r\n 44 \r\n 45 #LoginGraceTime 2m\r\n 46 PermitRootLogin yes<\/strong>\r\n 47 #StrictModes yes\r\n 48 #MaxAuthTries 6\r\n 49 #MaxSessions 10 \r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n[root@Server ~]# systemctl restart sshd \r\n[root@Server ~]# systemctl enable sshd<\/pre>\n

\u5982\u679c\u60f3\u4f7f\u7528Windows\u7cfb\u7edf\u8fdb\u884c\u8bbf\u95ee\u4e5f\u6ca1\u95ee\u9898\u3002\u9996\u5148\u786e\u4fdd\u7f51\u7edc\u662f\u53ef\u4ee5\u901a\u4fe1\u7684\uff0c\u968f\u540e\u4eceXshell\u3001PuTTY\u3001SecureCRT\u3001SSH Secure Shell Client\u7b49\u5de5\u5177\u4e2d\u9009\u62e9\u4e00\u4e2a\u559c\u6b22\u7684\u767b\u5f55\u5de5\u5177\uff0c\u8fdc\u7a0b\u8fde\u63a5\u4e00\u4e0b\u8bd5\u8bd5\u770b\uff0c\u6548\u679c\u5982\u56fe9-14\uff5e\u56fe9-16\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-14 \u8fdc\u7a0b\u767b\u5f55\u8f93\u5165\u8d26\u53f7\u540d\u79f0<\/p>\n

\"\"<\/p>\n

\u56fe9-15 \u8fdc\u7a0b\u767b\u5f55\u8f93\u5165\u8d26\u53f7\u5bc6\u7801<\/p>\n

\"\"<\/p>\n

\u56fe9-16 \u8fdc\u7a0b\u767b\u5f55\u6210\u529f\u754c\u9762<\/p>\n

9.2.2 \u5b89\u5168\u5bc6\u94a5\u9a8c\u8bc1<\/strong><\/span><\/h6>\n

\u52a0\u5bc6\u662f\u5bf9\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\u548c\u89e3\u7801\u7684\u6280\u672f\uff0c\u5b83\u901a\u8fc7\u4e00\u5b9a\u7684\u7b97\u6cd5\uff08\u5bc6\u94a5\uff09\u5c06\u539f\u672c\u80fd\u88ab\u76f4\u63a5\u9605\u8bfb\u7684\u660e\u6587\u4fe1\u606f\u8f6c\u6362\u6210\u5bc6\u6587\u5f62\u5f0f\u3002\u5bc6\u94a5\u5373\u662f\u5bc6\u6587\u7684\u94a5\u5319\uff0c\u6709\u79c1\u94a5\u548c\u516c\u94a5\u4e4b\u5206\u3002\u5728\u4f20\u8f93\u6570\u636e\u65f6\uff0c\u5982\u679c\u62c5\u5fc3\u88ab\u4ed6\u4eba\u76d1\u542c\u6216\u622a\u83b7\uff0c\u5c31\u53ef\u4ee5\u5728\u4f20\u8f93\u524d\u5148\u4f7f\u7528\u516c\u94a5\u5bf9\u6570\u636e\u52a0\u5bc6\u5904\u7406\uff0c\u7136\u540e\u518d\u8fdb\u884c\u4f20\u9001\u3002\u8fd9\u6837\uff0c\u53ea\u6709\u638c\u63e1\u79c1\u94a5\u7684\u7528\u6237\u624d\u80fd\u89e3\u5bc6\u8fd9\u6bb5\u6570\u636e\uff0c\u9664\u6b64\u4e4b\u5916\u7684\u5176\u4ed6\u4eba\u5373\u4fbf\u622a\u83b7\u4e86\u6570\u636e\uff0c\u4e00\u822c\u4e5f\u5f88\u96be\u5c06\u5176\u7834\u8bd1\u4e3a\u660e\u6587\u4fe1\u606f\u3002<\/p>\n

\u4e00\u8a00\u4ee5\u853d\u4e4b\uff0c\u5728\u751f\u4ea7\u73af\u5883\u4e2d\u4f7f\u7528\u5bc6\u7801\u8fdb\u884c\u9a8c\u8bc1\u7ec8\u5f52\u5b58\u5728\u7740\u88ab\u66b4\u529b\u7834\u89e3\u6216\u55c5\u63a2\u622a\u83b7\u7684\u98ce\u9669\u3002\u5982\u679c\u6b63\u786e\u914d\u7f6e\u4e86\u5bc6\u94a5\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u90a3\u4e48sshd\u670d\u52a1\u7a0b\u5e8f\u5c06\u66f4\u52a0\u5b89\u5168\u3002\u4e0b\u9762\u8fdb\u884c\u5177\u4f53\u7684\u914d\u7f6e\uff0c\u5176\u6b65\u9aa4\u5982\u4e0b\u3002<\/p>\n

\u7b2c1\u6b65<\/strong>\uff1a\u5728\u5ba2\u6237\u7aef\u4e3b\u673a\u4e2d\u751f\u6210\u201c\u5bc6\u94a5\u5bf9\u201d\uff0c\u8bb0\u4f4f\u662f\u5ba2\u6237\u7aef\u3002<\/p>\n

[root@Client ~]# ssh-keygen\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/root\/.ssh\/id_rsa): \u6309\u56de\u8f66\u952e\u6216\u8bbe\u7f6e\u5bc6\u94a5\u7684\u5b58\u50a8\u8def\u5f84<\/strong>\r\nEnter passphrase (empty for no passphrase): \u76f4\u63a5\u6309\u56de\u8f66\u952e\u6216\u8bbe\u7f6e\u5bc6\u94a5\u7684\u5bc6\u7801<\/strong>\r\nEnter same passphrase again: \u518d\u6b21\u6309\u56de\u8f66\u952e\u6216\u8bbe\u7f6e\u5bc6\u94a5\u7684\u5bc6\u7801<\/strong>\r\nYour identification has been saved in \/root\/.ssh\/id_rsa.\r\nYour public key has been saved in \/root\/.ssh\/id_rsa.pub.\r\nThe key fingerprint is:\r\nSHA256:kHa7B8V0nk63evABRrfZhxUpLM5Hx0I6gb7isNG9Hkg root@lrxjmw.cn\r\nThe key's randomart image is:\r\n+---[RSA 2048]----+\r\n|          o.=.o.+|\r\n|       . + =oB X |\r\n|      + o =oO O o|\r\n|     . o + *.+ ..|\r\n|      .ES . + o  |\r\n|     o.o.=   + . |\r\n|      =.o.o . o  |\r\n|     . . o.  .   |\r\n|        ..       |\r\n+----[SHA256]-----+\r\n<\/pre>\n

\u7b2c2\u6b65<\/strong>\uff1a\u628a\u5ba2\u6237\u7aef\u4e3b\u673a\u4e2d\u751f\u6210\u7684\u516c\u94a5\u6587\u4ef6\u4f20\u9001\u81f3\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n

[root@Client ~]# ssh-copy-id 192.168.10.10\r\n\/usr\/bin\/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed\r\n\/usr\/bin\/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys\r\nroot@192.168.10.10's password: \u6b64\u5904\u8f93\u5165\u670d\u52a1\u5668\u7ba1\u7406\u5458\u5bc6\u7801<\/strong>\r\n\r\nNumber of key(s) added: 1\r\n\r\nNow try logging into the machine, with:   \"ssh '192.168.10.10'\"\r\nand check to make sure that only the key(s) you wanted were added.\r\n<\/pre>\n

\u7b2c3\u6b65<\/strong>\uff1a\u5bf9\u670d\u52a1\u5668\u8fdb\u884c\u8bbe\u7f6e\uff0c\u4f7f\u5176\u53ea\u5141\u8bb8\u5bc6\u94a5\u9a8c\u8bc1\uff0c\u62d2\u7edd\u4f20\u7edf\u7684\u5bc6\u7801\u9a8c\u8bc1\u65b9\u5f0f\u3002\u8bb0\u5f97\u5728\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u540e\u4fdd\u5b58\u5e76\u91cd\u542fsshd\u670d\u52a1\u7a0b\u5e8f\u3002<\/p>\n

[root@Server ~]# vim \/etc\/ssh\/sshd_config\u00a0\r\n \u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n 70 # To disable tunneled clear text passwords, change to no here!\r\n 71 #PasswordAuthentication yes\r\n 72 #PermitEmptyPasswords no\r\n 73 PasswordAuthentication no<\/strong>\r\n 74 \r\n \u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n[root@Server ~]# systemctl restart sshd<\/pre>\n

\u7b2c4\u6b65<\/strong>\uff1a\u5ba2\u6237\u7aef\u5c1d\u8bd5\u767b\u5f55\u5230\u670d\u52a1\u5668\uff0c\u6b64\u65f6\u65e0\u987b\u8f93\u5165\u5bc6\u7801\u4e5f\u53ef\u6210\u529f\u767b\u5f55\uff0c\u7279\u522b\u65b9\u4fbf\u3002<\/p>\n

[root@Client ~]# ssh 192.168.10.10\r\nActivate the web console with: systemctl enable --now cockpit.socket\r\n\r\nLast failed login: Thu Jan 28 13:44:09 CST 2021 from 192.168.10.20 on ssh:notty\r\nThere were 2 failed login attempts since the last successful login.\r\nLast login: Thu Jan 28 13:22:34 2021 from 192.168.10.20\r\n<\/pre>\n

\u4f46\u662f\uff0c\u5982\u679c\u7528\u6237\u6ca1\u6709\u5bc6\u94a5\u4fe1\u606f\uff0c\u5373\u4fbf\u6709\u5bc6\u7801\u4e5f\u4f1a\u88ab\u62d2\u7edd\uff0c\u7cfb\u7edf\u751a\u81f3\u4e0d\u4f1a\u7ed9\u7528\u6237\u8f93\u5165\u5bc6\u7801\u7684\u673a\u4f1a\uff0c\u5982\u56fe9-17\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-17 \u65e0\u5bc6\u94a5\u8bbf\u95ee\u8fdc\u7a0b\u670d\u52a1\u5668\u88ab\u62d2<\/p>\n

9.2.3 \u8fdc\u7a0b\u4f20\u8f93\u547d\u4ee4<\/strong><\/span><\/h6>\n

\u4e0d\u77e5\u9053\u8bfb\u8005\u6709\u6ca1\u6709\u8003\u8651\u4e00\u4e2a\u95ee\u9898\uff1a\u65e2\u7136SSH\u534f\u8bae\u53ef\u4ee5\u8ba9\u7528\u6237\u8fdc\u7a0b\u63a7\u5236\u670d\u52a1\u5668\u3001\u4f20\u8f93\u547d\u4ee4\u4fe1\u606f\uff0c\u90a3\u4e48\u662f\u4e0d\u662f\u4e5f\u80fd\u4f20\u8f93\u6587\u4ef6\u5462\uff1f<\/p>\n

scp\uff08secure copy\uff09\u662f\u4e00\u4e2a\u57fa\u4e8eSSH\u534f\u8bae\u5728\u7f51\u7edc\u4e4b\u95f4\u8fdb\u884c\u5b89\u5168\u4f20\u8f93\u7684\u547d\u4ee4\uff0c\u5176\u683c\u5f0f\u4e3a\u201cscp [\u53c2\u6570]\u672c\u5730\u6587\u4ef6 \u8fdc\u7a0b\u8d26\u6237@\u8fdc\u7a0bIP\u5730\u5740:\u8fdc\u7a0b\u76ee\u5f55\u201d\u3002<\/p>\n

\u4e0e\u7b2c2\u7ae0\u8bb2\u89e3\u7684cp\u547d\u4ee4\u4e0d\u540c\uff0ccp\u547d\u4ee4\u53ea\u80fd\u5728\u672c\u5730\u786c\u76d8\u4e2d\u8fdb\u884c\u6587\u4ef6\u590d\u5236\uff0c\u800cscp\u4e0d\u4ec5\u80fd\u591f\u901a\u8fc7\u7f51\u7edc\u4f20\u9001\u6570\u636e\uff0c\u800c\u4e14\u6240\u6709\u7684\u6570\u636e\u90fd\u5c06\u8fdb\u884c\u52a0\u5bc6\u5904\u7406\u3002\u4f8b\u5982\uff0c\u5982\u679c\u60f3\u628a\u4e00\u4e9b\u6587\u4ef6\u901a\u8fc7\u7f51\u7edc\u4ece\u4e00\u53f0\u4e3b\u673a\u4f20\u9012\u5230\u5176\u4ed6\u4e3b\u673a\uff0c\u8fd9\u4e24\u53f0\u4e3b\u673a\u53c8\u6070\u5de7\u90fd\u662fLinux\u7cfb\u7edf\uff0c\u8fd9\u65f6\u4f7f\u7528scp\u547d\u4ee4\u5c31\u53ef\u4ee5\u8f7b\u677e\u5b8c\u6210\u6587\u4ef6\u7684\u4f20\u9012\u4e86\u3002scp\u547d\u4ee4\u4e2d\u53ef\u7528\u7684\u53c2\u6570\u4ee5\u53ca\u4f5c\u7528\u5982\u88689-3\u6240\u793a\u3002<\/p>\n

\u88689-3\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 scp\u547d\u4ee4\u4e2d\u53ef\u7528\u7684\u53c2\u6570\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-v<\/td>\n\u663e\u793a\u8be6\u7ec6\u7684\u8fde\u63a5\u8fdb\u5ea6<\/td>\n<\/tr>\n
-P<\/td>\n\u6307\u5b9a\u8fdc\u7a0b\u4e3b\u673a\u7684sshd\u7aef\u53e3\u53f7<\/td>\n<\/tr>\n
-r<\/td>\n\u7528\u4e8e\u4f20\u9001\u6587\u4ef6\u5939<\/td>\n<\/tr>\n
-6<\/td>\n\u4f7f\u7528IPv6\u534f\u8bae<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5728\u4f7f\u7528scp\u547d\u4ee4\u628a\u6587\u4ef6\u4ece\u672c\u5730\u590d\u5236\u5230\u8fdc\u7a0b\u4e3b\u673a\u65f6\uff0c\u9996\u5148\u9700\u8981\u4ee5\u7edd\u5bf9\u8def\u5f84\u7684\u5f62\u5f0f\u5199\u6e05\u672c\u5730\u6587\u4ef6\u7684\u5b58\u653e\u4f4d\u7f6e\u3002\u5982\u679c\u8981\u4f20\u9001\u6574\u4e2a\u6587\u4ef6\u5939\u5185\u7684\u6240\u6709\u6570\u636e\uff0c\u8fd8\u9700\u8981\u989d\u5916\u6dfb\u52a0\u53c2\u6570-r\u8fdb\u884c\u9012\u5f52\u64cd\u4f5c\u3002\u7136\u540e\u5199\u4e0a\u8981\u4f20\u9001\u5230\u7684\u8fdc\u7a0b\u4e3b\u673a\u7684IP\u5730\u5740\uff0c\u8fdc\u7a0b\u670d\u52a1\u5668\u4fbf\u4f1a\u8981\u6c42\u8fdb\u884c\u8eab\u4efd\u9a8c\u8bc1\u4e86\u3002\u5f53\u524d\u7528\u6237\u540d\u79f0\u4e3aroot\uff0c\u800c\u5bc6\u7801\u5219\u4e3a\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u5bc6\u7801\u3002\u5982\u679c\u60f3\u4f7f\u7528\u6307\u5b9a\u7528\u6237\u7684\u8eab\u4efd\u8fdb\u884c\u9a8c\u8bc1\uff0c\u53ef\u4f7f\u7528\u7528\u6237\u540d@\u4e3b\u673a\u5730\u5740\u7684\u53c2\u6570\u683c\u5f0f\u3002\u6700\u540e\u9700\u8981\u5728\u8fdc\u7a0b\u4e3b\u673a\u7684IP\u5730\u5740\u540e\u9762\u6dfb\u52a0\u5192\u53f7\uff0c\u5e76\u5728\u540e\u9762\u5199\u4e0a\u8981\u4f20\u9001\u5230\u8fdc\u7a0b\u4e3b\u673a\u7684\u54ea\u4e2a\u6587\u4ef6\u5939\u4e2d\u3002\u53ea\u8981\u53c2\u6570\u6b63\u786e\u5e76\u4e14\u6210\u529f\u9a8c\u8bc1\u4e86\u7528\u6237\u8eab\u4efd\uff0c\u5373\u53ef\u5f00\u59cb\u4f20\u9001\u5de5\u4f5c\u3002\u7531\u4e8escp\u547d\u4ee4\u662f\u57fa\u4e8eSSH\u534f\u8bae\u8fdb\u884c\u6587\u4ef6\u4f20\u9001\u7684\uff0c\u800c9.2.2\u8282\u53c8\u8bbe\u7f6e\u597d\u4e86\u5bc6\u94a5\u9a8c\u8bc1\uff0c\u56e0\u6b64\u5f53\u524d\u5728\u4f20\u8f93\u6587\u4ef6\u65f6\uff0c\u5e76\u4e0d\u9700\u8981\u8d26\u6237\u548c\u5bc6\u7801\u3002<\/p>\n

[root@Client ~]# echo \"Welcome to lrxjmw.cn\" > readme.txt\r\n[root@Client ~]# scp \/root\/readme.txt 192.168.10.10:\/home\r\nreadme.txt                                    100%   26    13.6KB\/s   00:00<\/pre>\n

\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528scp\u547d\u4ee4\u628a\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684\u6587\u4ef6\u4e0b\u8f7d\u5230\u672c\u5730\u4e3b\u673a\uff0c\u5176\u547d\u4ee4\u683c\u5f0f\u4e3a\u201cscp [\u53c2\u6570]\u8fdc\u7a0b\u7528\u6237@\u8fdc\u7a0bIP\u5730\u5740:\u8fdc\u7a0b\u6587\u4ef6 \u672c\u5730\u76ee\u5f55\u201d\u3002\u8fd9\u6837\u5c31\u65e0\u987b\u5148\u767b\u5f55\u8fdc\u7a0b\u4e3b\u673a\u518d\u8fdb\u884c\u6587\u4ef6\u4f20\u9001\u4e86\uff0c\u4e5f\u5c31\u7701\u53bb\u4e86\u5f88\u591a\u5468\u6298\u3002\u4f8b\u5982\uff0c\u53ef\u4ee5\u628a\u8fdc\u7a0b\u4e3b\u673a\u7684\u7cfb\u7edf\u7248\u672c\u4fe1\u606f\u6587\u4ef6\u4e0b\u8f7d\u8fc7\u6765\u3002<\/p>\n

[root@Client ~]# scp 192.168.10.10:\/etc\/redhat-release \/root\r\n[root@Client ~]# scp 192.168.10.10:\/etc\/redhat-release \/root\r\nredhat-release                                100%   45    23.6KB\/s   00:00    \r\n[root@Client ~]# cat redhat-release \r\nRed Hat Enterprise Linux release 8.0 (Ootpa)\r\n<\/pre>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

9.3 \u4e0d\u95f4\u65ad\u4f1a\u8bdd\u670d\u52a1<\/strong><\/span><\/h5>\n

\u5927\u5bb6\u5728\u5b66\u4e60sshd\u670d\u52a1\u65f6\uff0c\u4e0d\u77e5\u6709\u6ca1\u6709\u6ce8\u610f\u5230\u8fd9\u6837\u4e00\u4e2a\u4e8b\u60c5\uff1a\u5f53\u4e0e\u8fdc\u7a0b\u4e3b\u673a\u7684\u4f1a\u8bdd\u88ab\u5173\u95ed\u65f6\uff0c\u5728\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u8fd0\u884c\u7684\u547d\u4ee4\u4e5f\u968f\u4e4b\u88ab\u4e2d\u65ad\u3002<\/p>\n

\u5982\u679c\u6b63\u5728\u4f7f\u7528\u547d\u4ee4\u6765\u6253\u5305\u6587\u4ef6\uff0c\u6216\u8005\u6b63\u5728\u4f7f\u7528\u811a\u672c\u5b89\u88c5\u67d0\u4e2a\u670d\u52a1\u7a0b\u5e8f\uff0c\u4e2d\u9014\u662f\u7edd\u5bf9\u4e0d\u80fd\u5173\u95ed\u5728\u672c\u5730\u6253\u5f00\u7684\u7ec8\u7aef\u7a97\u53e3\u6216\u65ad\u5f00\u7f51\u7edc\u8fde\u63a5\u7684\uff0c\u751a\u81f3\u8fde\u7f51\u901f\u7684\u6ce2\u52a8\u90fd\u6709\u53ef\u80fd\u5bfc\u81f4\u4efb\u52a1\u4e2d\u65ad\uff0c\u6b64\u65f6\u53ea\u80fd\u91cd\u65b0\u8fdb\u884c\u8fdc\u7a0b\u8fde\u63a5\u5e76\u91cd\u65b0\u5f00\u59cb\u4efb\u52a1\u3002\u8fd8\u6709\u4e9b\u65f6\u5019\uff0c\u6211\u4eec\u6b63\u5728\u6267\u884c\u6587\u4ef6\u6253\u5305\u64cd\u4f5c\uff0c\u540c\u65f6\u53c8\u60f3\u7528\u811a\u672c\u6765\u5b89\u88c5\u67d0\u4e2a\u670d\u52a1\u7a0b\u5e8f\uff0c\u8fd9\u65f6\u4f1a\u56e0\u4e3a\u6253\u5305\u64cd\u4f5c\u7684\u8f93\u51fa\u4fe1\u606f\u5360\u6ee1\u7528\u6237\u7684\u5c4f\u5e55\u754c\u9762\uff0c\u800c\u53ea\u80fd\u518d\u6253\u5f00\u4e00\u4e2a\u6267\u884c\u8fdc\u7a0b\u4f1a\u8bdd\u7684\u7ec8\u7aef\u7a97\u53e3\u3002\u65f6\u95f4\u4e45\u4e86\uff0c\u96be\u514d\u4f1a\u5fd8\u8bb0\u8fd9\u4e9b\u6253\u5f00\u7684\u7ec8\u7aef\u7a97\u53e3\u662f\u505a\u4ec0\u4e48\u7528\u7684\u4e86\u3002<\/p>\n

Terminal Multiplexer\uff08\u7ec8\u7aef\u590d\u7528\u5668\uff0c\u7b80\u79f0\u4e3aTmux\uff09\u662f\u4e00\u6b3e\u80fd\u591f\u5b9e\u73b0\u591a\u7a97\u53e3\u8fdc\u7a0b\u63a7\u5236\u7684\u5f00\u6e90\u670d\u52a1\u7a0b\u5e8f\u3002\u7b80\u5355\u6765\u8bf4\u5c31\u662f\u4e3a\u4e86\u89e3\u51b3\u7f51\u7edc\u5f02\u5e38\u4e2d\u65ad\u6216\u4e3a\u4e86\u540c\u65f6\u63a7\u5236\u591a\u4e2a\u8fdc\u7a0b\u7ec8\u7aef\u7a97\u53e3\u800c\u8bbe\u8ba1\u7684\u7a0b\u5e8f\u3002\u7528\u6237\u8fd8\u53ef\u4ee5\u4f7f\u7528Tmux\u670d\u52a1\u7a0b\u5e8f\u540c\u65f6\u5728\u591a\u4e2a\u8fdc\u7a0b\u4f1a\u8bdd\u4e2d\u81ea\u7531\u5207\u6362\uff0c\u80fd\u591f\u5b9e\u73b0\u5982\u4e0b\u529f\u80fd\u3002<\/p>\n

\u4f1a\u8bdd\u6062\u590d<\/strong>\uff1a\u5373\u4fbf\u7f51\u7edc\u4e2d\u65ad\uff0c\u4e5f\u53ef\u8ba9\u4f1a\u8bdd\u968f\u65f6\u6062\u590d\uff0c\u786e\u4fdd\u7528\u6237\u4e0d\u4f1a\u5931\u53bb\u5bf9\u8fdc\u7a0b\u4f1a\u8bdd\u7684\u63a7\u5236\u3002<\/p>\n

\u591a\u7a97\u53e3<\/strong>\uff1a\u6bcf\u4e2a\u4f1a\u8bdd\u90fd\u662f\u72ec\u7acb\u8fd0\u884c\u7684\uff0c\u62e5\u6709\u5404\u81ea\u72ec\u7acb\u7684\u8f93\u5165\u8f93\u51fa\u7ec8\u7aef\u7a97\u53e3\uff0c\u7ec8\u7aef\u7a97\u53e3\u5185\u663e\u793a\u8fc7\u7684\u4fe1\u606f\u4e5f\u5c06\u88ab\u5206\u5f00\u9694\u79bb\u4fdd\u5b58\uff0c\u4ee5\u4fbf\u4e0b\u6b21\u4f7f\u7528\u65f6\u4f9d\u7136\u80fd\u770b\u5230\u4e4b\u524d\u7684\u64cd\u4f5c\u8bb0\u5f55\u3002<\/p>\n

\u4f1a\u8bdd\u5171\u4eab<\/strong>\uff1a\u5f53\u591a\u4e2a\u7528\u6237\u540c\u65f6\u767b\u5f55\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\u65f6\uff0c\u4fbf\u53ef\u4ee5\u4f7f\u7528\u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\u8ba9\u7528\u6237\u4e4b\u95f4\u7684\u8f93\u5165\u8f93\u51fa\u4fe1\u606f\u5171\u4eab\u3002<\/p><\/blockquote>\n

\u5728RHEL 8\u7cfb\u7edf\u4e2d\uff0c\u9ed8\u8ba4\u6ca1\u6709\u5b89\u88c5Tmux\u670d\u52a1\u7a0b\u5e8f\uff0c\u56e0\u6b64\u9700\u8981\u914d\u7f6e\u8f6f\u4ef6\u4ed3\u5e93\u6765\u5b89\u88c5\u5b83\u3002\u914d\u7f6e\u8f6f\u4ef6\u4ed3\u5e93\u7684\u6b65\u9aa4\u8bf7\u89c18.3.2\u8282\uff0cBaseOS\u548cAppStream\u90fd\u8981\u914d\u7f6e\uff0c\u8fd9\u91cc\u76f4\u63a5\u5f00\u59cb\u5b89\u88c5Tmux\uff1a<\/p>\n

[root@linuxprobe ~]# dnf install tmux\r\nUpdating Subscription Management repositories.\r\nUnable to read consumer identity\r\nThis system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.\r\nAppStream                                       3.1 MB\/s | 3.2 kB     00:00    \r\nBaseOS                                          2.7 MB\/s | 2.7 kB     00:00    \r\nDependencies resolved.\r\n================================================================================\r\n Package         Arch              Version              Repository         Size\r\n================================================================================\r\nInstalling:\r\n tmux            x86_64            2.7-1.el8            BaseOS            317 k\r\n\r\nTransaction Summary\r\n================================================================================\r\nInstall  1 Package\r\n\r\nTotal size: 317 k\r\nInstalled size: 770 k\r\nIs this ok [y\/N]: y\r\nDownloading Packages:\r\nRunning transaction check\r\nTransaction check succeeded.\r\nRunning transaction test\r\nTransaction test succeeded.\r\nRunning transaction\r\n  Preparing        :                                                        1\/1 \r\n  Installing       : tmux-2.7-1.el8.x86_64                                  1\/1 \r\n  Running scriptlet: tmux-2.7-1.el8.x86_64                                  1\/1 \r\n  Verifying        : tmux-2.7-1.el8.x86_64                                  1\/1 \r\nInstalled products updated.\r\n\r\nInstalled:\r\n  tmux-2.7-1.el8.x86_64                                                         \r\n\r\nComplete!\r\n<\/pre>\n
\n
\n

Tips<\/strong><\/h3>\n<\/div>\n
\n

\u7b80\u6377\u8d77\u89c1\uff0c\u5218\u9044\u8001\u5e08\u5c06\u5bf9\u540e\u9762\u7ae0\u8282\u4e2d\u51fa\u73b0\u7684\u8f6f\u4ef6\u5b89\u88c5\u4fe1\u606f\u8fdb\u884c\u8fc7\u6ee4\u2014\u628a\u91cd\u590d\u6027\u9ad8\u53ca\u65e0\u610f\u4e49\u7684\u975e\u5fc5\u8981\u4fe1\u606f\u7701\u7565\u3002<\/p>\n<\/div>\n<\/div>\n

9.3.1\u00a0\u7ba1\u7406\u8fdc\u7a0b\u4f1a\u8bdd<\/span><\/strong><\/h6>\n

Tmux\u670d\u52a1\u80fd\u505a\u7684\u4e8b\u60c5\u975e\u5e38\u591a\uff0c\u4f8b\u5982\u521b\u5efa\u4e0d\u95f4\u65ad\u4f1a\u8bdd\u3001\u6062\u590d\u79bb\u7ebf\u5de5\u4f5c\u3001\u5c06\u754c\u9762\u5207\u5206\u4e3a\u4e0d\u540c\u7684\u7a97\u683c\u3001\u5171\u4eab\u4f1a\u8bdd\u7b49\u3002\u4e0b\u9762\u76f4\u63a5\u6572\u51fbtmux\u547d\u4ee4\u8fdb\u5165\u4f1a\u8bdd\u7a97\u53e3\u4e2d\uff0c\u5982\u56fe9-18\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-18 Tumx\u670d\u52a1\u7a0b\u5e8f\u4f1a\u8bdd\u754c\u9762<\/p>\n

\u4e0d\u96be\u53d1\u73b0\uff0c\u4f1a\u8bdd\u7a97\u53e3\u7684\u5e95\u90e8\u51fa\u73b0\u4e86\u4e00\u4e2a\u7eff\u8272\u7684\u72b6\u6001\u680f\uff0c\u91cc\u9762\u5206\u522b\u663e\u793a\u7684\u662f\u4f1a\u8bdd\u7f16\u53f7\u3001\u540d\u79f0\u3001\u4e3b\u673a\u540d\u53ca\u7cfb\u7edf\u65f6\u95f4\u3002<\/p>\n

\u9000\u51fa\u4f1a\u8bdd\u7a97\u53e3\u7684\u547d\u4ee4\u662fexit\uff0c\u6572\u51fb\u540e\u5373\u53ef\u8fd4\u56de\u5230\u6b63\u5e38\u7684\u7ec8\u7aef\u754c\u9762\uff0c\u5982\u56fe9-19\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-19 \u4ece\u4f1a\u8bdd\u7a97\u53e3\u9000\u56de\u5230\u7ec8\u7aef\u754c\u9762<\/p>\n

\u4f1a\u8bdd\u7a97\u53e3\u7684\u7f16\u53f7\u662f\u4ece0\u5f00\u59cb\u81ea\u52a8\u6392\u5e8f\uff08\u53730\u30011\u30012\u30013\u3001\u2026\u2026\uff09\uff0c\u4f1a\u8bdd\u7a97\u53e3\u6570\u91cf\u5c11\u7684\u65f6\u5019\u8fd8\u6ca1\u5173\u7cfb\uff0c\u6570\u91cf\u591a\u7684\u65f6\u5019\u533a\u5206\u8d77\u6765\u5c31\u5f88\u9ebb\u70e6\u4e86\u3002\u63a5\u4e0b\u6765\u521b\u5efa\u4e00\u4e2a\u6307\u5b9a\u540d\u79f0\u4e3abackup\u7684\u4f1a\u8bdd\u7a97\u53e3\u3002\u8bf7\u5404\u4f4d\u8bfb\u8005\u7559\u5fc3\u89c2\u5bdf\uff0c\u5f53\u5728\u547d\u4ee4\u884c\u4e2d\u6572\u4e0b\u4e0b\u9762\u8fd9\u6761\u547d\u4ee4\u7684\u4e00\u77ac\u95f4\uff0c\u5c4f\u5e55\u4f1a\u5feb\u901f\u95ea\u52a8\u4e00\u4e0b\uff0c\u8fd9\u65f6\u5c31\u5df2\u7ecf\u8fdb\u5165Tmux\u4f1a\u8bdd\u4e2d\u4e86\uff0c\u5728\u91cc\u9762\u6267\u884c\u7684\u4efb\u4f55\u64cd\u4f5c\u90fd\u4f1a\u88ab\u540e\u53f0\u8bb0\u5f55\u4e0b\u6765\u3002<\/p>\n

[root@linuxprobe ~]# tmux new -s backup\r\n<\/pre>\n

\u5047\u8bbe\u6211\u4eec\u7a81\u7136\u8981\u53bb\u5fd9\u5176\u4ed6\u4e8b\u60c5\uff0c\u4f46\u4f1a\u8bdd\u7a97\u53e3\u4e2d\u6267\u884c\u7684\u8fdb\u7a0b\u8fd8\u4e0d\u80fd\u88ab\u4e2d\u65ad\uff0c\u6b64\u65f6\u4fbf\u53ef\u4ee5\u7528detach\u53c2\u6570\u5c06\u4f1a\u8bdd\u9690\u85cf\u5230\u540e\u53f0\u3002\u867d\u7136\u770b\u8d77\u6765\u4e0e\u521a\u624d\u6ca1\u6709\u4e0d\u540c\uff0c\u4f46\u5b9e\u9645\u4e0a\u53ef\u4ee5\u770b\u5230\u5f53\u524d\u7684\u4f1a\u8bdd\u6b63\u5728\u5de5\u4f5c\u4e2d\uff1a<\/p>\n

[root@linuxprobe ~]# tmux detach\r\n[detached (from session backup)]<\/pre>\n

\u5982\u679c\u89c9\u5f97\u6bcf\u6b21\u8f93\u5165detach\u53c2\u6570\u90fd\u5f88\u9ebb\u70e6\uff0c\u53ef\u4ee5\u76f4\u63a5\u5982\u56fe9-20\u6240\u793a\u5173\u95ed\u4e2d\u65ad\u7a97\u53e3\uff08\u8fd9\u4e0e\u8fdb\u884c\u8fdc\u7a0b\u8fde\u63a5\u65f6\u7a81\u7136\u65ad\u7f51\u5177\u6709\u76f8\u540c\u7684\u6548\u679c\uff09\uff0cTmux\u670d\u52a1\u7a0b\u5e8f\u4f1a\u81ea\u52a8\u5e2e\u6211\u4eec\u8fdb\u884c\u4fdd\u5b58\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-20 \u5f3a\u884c\u5173\u95ed\u4f1a\u8bdd\u7a97\u53e3<\/p>\n

\u8fd9\u6837\u64cd\u4f5c\u4e4b\u540e\uff0c\u670d\u52a1\u548c\u8fdb\u7a0b\u90fd\u4f1a\u4e00\u76f4\u5728\u540e\u53f0\u9ed8\u9ed8\u8fd0\u884c\uff0c\u4e0d\u4f1a\u56e0\u4e3a\u7a97\u53e3\u88ab\u5173\u95ed\u800c\u9020\u6210\u6570\u636e\u4e22\u5931\u3002\u4e0d\u653e\u5fc3\u7684\u8bdd\u53ef\u4ee5\u67e5\u770b\u4e00\u4e0b\u540e\u53f0\u6709\u54ea\u4e9b\u4f1a\u8bdd\uff1a<\/p>\n

[root@linuxprobe ~]# tmux ls\r\nbackup: 1 windows (created Thu Jan 28 15:57:40 2021) [80x23]<\/pre>\n

\u5728\u4f20\u7edf\u7684\u8fdc\u7a0b\u63a7\u5236\u4e2d\uff0c\u5982\u679c\u7a81\u7136\u5173\u95ed\u4f1a\u8bdd\u7a97\u53e3\uff0c\u4e00\u5b9a\u4f1a\u5bfc\u81f4\u6b63\u5728\u8fd0\u884c\u7684\u547d\u4ee4\u4e5f\u7a81\u7136\u7ec8\u6b62\uff0c\u4f46\u662f\u5728Tmux\u7684\u4e0d\u95f4\u65ad\u4f1a\u8bdd\u670d\u52a1\u4e2d\u5219\u4e0d\u4f1a\u8fd9\u6837\u3002\u6211\u4eec\u53ea\u9700\u67e5\u770b\u4e00\u4e0b\u521a\u521a\u5173\u95ed\u7684\u79bb\u7ebf\u4f1a\u8bdd\u540d\u79f0\uff0c\u7136\u540e\u5c1d\u8bd5\u6062\u590d\u56de\u6765\uff0c\u8fd9\u4e2a\u4f1a\u8bdd\u5c31\u53ef\u4ee5\u7ee7\u7eed\u5de5\u4f5c\u4e86\u3002\u56de\u5f52\u5230backup\u4f1a\u8bdd\u4e2d\u7684\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c\u76f4\u63a5\u5728tmux\u547d\u4ee4\u540e\u9762\u52a0attach\u548c\u4f1a\u8bdd\u7f16\u53f7\u6216\u4f1a\u8bdd\u540d\u79f0\u5c31\u53ef\u4ee5\u3002\u5173\u95ed\u4f1a\u8bdd\u7a97\u53e3\u4e4b\u524d\u6b63\u5728\u8fdb\u884c\u7684\u4e00\u5207\u5de5\u4f5c\u72b6\u6001\u90fd\u4f1a\u88ab\u539f\u539f\u672c\u672c\u5730\u5448\u73b0\u51fa\u6765\uff0c\u4e1d\u6beb\u4e0d\u53d7\u5f71\u54cd\uff1a<\/p>\n

[root@linuxprobe ~]# tmux attach -t backup<\/pre>\n

\u5982\u679c\u4e0d\u518d\u9700\u8981\u4f7f\u7528\u8fd9\u4e2aTmux\u4f1a\u8bdd\u4e86\uff0c\u4e5f\u4e0d\u7528\u5148\u5728tmux\u547d\u4ee4\u540e\u9762\u6dfb\u52a0attach\uff0c\u518d\u6267\u884cexit\u547d\u4ee4\u9000\u51fa\uff0c\u800c\u662f\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528kill\u547d\u4ee4\u6740\u6b7b\u8fd9\u4e2a\u4f1a\u8bdd\u3002<\/p>\n

[root@linuxprobe ~]# tmux attach -t backup\r\n[exited]\r\n[root@linuxprobe ~]# tmux ls\r\nno server running on \/tmp\/tmux-0\/default\r\n<\/pre>\n

\u5728\u65e5\u5e38\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u5176\u5b9e\u5e76\u4e0d\u662f\u5fc5\u987b\u5148\u521b\u5efa\u4f1a\u8bdd\uff0c\u7136\u540e\u518d\u5f00\u59cb\u5de5\u4f5c\u3002\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528tmux\u547d\u4ee4\u6267\u884c\u8981\u8fd0\u884c\u7684\u6307\u4ee4\uff0c\u8fd9\u6837\u547d\u4ee4\u4e2d\u7684\u4e00\u5207\u64cd\u4f5c\u90fd\u4f1a\u88ab\u8bb0\u5f55\u4e0b\u6765\uff0c\u5f53\u547d\u4ee4\u6267\u884c\u7ed3\u675f\u540e\uff0c\u540e\u53f0\u4f1a\u8bdd\u4e5f\u4f1a\u81ea\u52a8\u7ed3\u675f\u3002<\/p>\n

[root@linuxprobe ~]# tmux new \"vim memo.txt\"\r\n<\/pre>\n
9.3.2 \u7ba1\u7406\u591a\u7a97\u683c<\/span><\/strong><\/h6>\n

\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\uff0c\u4e00\u4e2aShell\u7ec8\u7aef\u7a97\u53e3\u603b\u662f\u4e0d\u591f\u7528\uff0c\u8fd9\u600e\u4e48\u529e\u5462\uff1fTmux\u670d\u52a1\u6709\u4e2a\u591a\u7a97\u683c\u529f\u80fd\uff0c\u80fd\u591f\u628a\u4e00\u4e2a\u7ec8\u7aef\u754c\u9762\u6309\u7167\u4e0a\u4e0b\u6216\u5de6\u53f3\u8fdb\u884c\u5207\u5272\uff0c\u4ece\u800c\u4f7f\u5f97\u80fd\u540c\u65f6\u505a\u591a\u4ef6\u4e8b\u60c5\uff0c\u800c\u4e14\u4e4b\u95f4\u4e92\u4e0d\u6253\u6270\uff0c\u7279\u522b\u65b9\u4fbf\u3002<\/p>\n

\u5148\u521b\u5efa\u4e00\u4e2a\u4f1a\u8bdd\u3002\u4f7f\u7528\u201ctmux split-window\u201d\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u4e0a\u4e0b\u5207\u5272\u7684\u591a\u7a97\u683c\u7ec8\u7aef\u754c\u9762\uff0c\u5982\u56fe9-21\u6240\u793a\u3002\u4f7f\u7528\u201ctmux split-window -h\u201d\u547d\u4ee4\u53ef\u4ee5\u521b\u5efa\u5de6\u53f3\u5207\u5272\u7684\u591a\u7a97\u683c\u7ec8\u7aef\u754c\u9762\uff0c\u5982\u56fe9-22\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-21 \u4e0a\u4e0b\u5207\u5272\u591a\u7a97\u683c<\/p>\n

\"\"<\/p>\n

\u56fe9-22 \u4e0a\u4e0b\u5207\u5272\u591a\u7a97\u683c<\/p>\n

\u521b\u5efa\u591a\u7a97\u683c\u7ec8\u7aef\u754c\u9762\u540e\uff0c\u6211\u4eec\u540c\u65f6\u505a\u51e0\u4ef6\u4e8b\u60c5\u90fd\u4e0d\u4f1a\u4e71\u4e86\u3002\u5982\u679c\u89c9\u5f97\u4e24\u4e2a\u7a97\u683c\u8fd8\u4e0d\u591f\uff0c\u90a3\u5c31\u518d\u6267\u884c\u51e0\u6b21\u4e0a\u9762\u7684\u547d\u4ee4\u5427\uff0c\u9000\u51fa\u65f6\u6267\u884cexit\u547d\u4ee4\u5373\u53ef\u3002<\/p>\n

\u5440\uff01\u4e00\u4e0d\u5c0f\u5fc3\u521b\u5efa\u5f97\u592a\u591a\u4e86\uff0c\u5f53\u524d\u6b63\u5728\u4f7f\u7528\u7684\u7a97\u683c\u53d8\u5f97\u7279\u522b\u5c0f\uff0c\u770b\u4e0d\u5230\u8f93\u5165\u5185\u5bb9\u4e86\uff0c\u600e\u4e48\u529e\u5462\uff1f\u4e0d\u8981\u7740\u6025\uff01\u53ef\u4ee5\u540c\u65f6\u6309\u4e0b\u201cCtrl + B +\u65b9\u5411\u952e\u201d\u8c03\u6574\u7a97\u683c\u7684\u5c3a\u5bf8\u3002\u4f8b\u5982\uff0c\u73b0\u5728\u4f7f\u7528\u7684\u7a97\u683c\u6709\u4e9b\u5c0f\uff0c\u60f3\u5411\u53f3\u6269\u5927\u4e00\u4e9b\uff0c\u5219\u540c\u65f6\u5982\u4e0b\u201cCtrl + B +\u53f3\u7bad\u5934\u952e\u201d\u5c31\u884c\u4e86\u3002<\/p>\n

\u5982\u679c\u9700\u8981\u5207\u6362\u5230\u5176\u4ed6\u7a97\u683c\u8fdb\u884c\u5de5\u4f5c\uff0c\u4f46\u53c8\u4e0d\u80fd\u5173\u95ed\u5f53\u524d\u7684\u7a97\u683c\uff0c\u5219\u53ef\u4f7f\u7528\u5982\u88689-4\u6240\u793a\u7684\u547d\u4ee4\u8fdb\u884c\u5207\u6362\u3002<\/p>\n

\u88689-4\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tmux\u4e0d\u95f4\u65ad\u4f1a\u8bdd\u591a\u7a97\u683c\u5207\u6362\u547d\u4ee4<\/p>\n\n\n\n\n\n\n\n
\u547d\u4ee4<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
tmux select-pane -U <\/td>\n\u5207\u6362\u81f3\u4e0a\u65b9\u7684\u7a97\u683c<\/td>\n<\/tr>\n
tmux select-pane -D <\/td>\n\u5207\u6362\u81f3\u4e0b\u65b9\u7684\u7a97\u683c<\/td>\n<\/tr>\n
tmux select-pane -L <\/td>\n\u5207\u6362\u81f3\u5de6\u65b9\u7684\u7a97\u683c<\/td>\n<\/tr>\n
tmux select-pane -R<\/td>\n\u5207\u6362\u81f3\u53f3\u65b9\u7684\u7a97\u683c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5047\u5982\u60f3\u8c03\u6574\u7a97\u683c\u7684\u4f4d\u7f6e\uff0c\u628a\u4e0a\u9762\u4e0e\u4e0b\u9762\u7684\u7a97\u683c\u4f4d\u7f6e\u4e92\u6362\uff0c\u5219\u53ef\u4ee5\u7528\u5982\u88689-5\u6240\u793a\u7684\u547d\u4ee4\u8fdb\u884c\u4e92\u6362\u3002<\/p>\n

\u88689-5\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tmux\u4e0d\u95f4\u65ad\u4f1a\u8bdd\u591a\u7a97\u683c\u4e92\u6362\u547d\u4ee4<\/p>\n\n\n\n\n\n
\u547d\u4ee4<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
tmux swap-pane -U<\/td>\n\u5c06\u5f53\u524d\u7a97\u683c\u4e0e\u4e0a\u65b9\u7684\u7a97\u683c\u4e92\u6362<\/td>\n<\/tr>\n
tmux swap-pane -D<\/td>\n\u5c06\u5f53\u524d\u7a97\u683c\u4e0e\u4e0b\u65b9\u7684\u7a97\u683c\u4e92\u6362<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5982\u56fe9-23\u6240\u793a\uff0c\u539f\u672c\u6267\u884c\u8fc7uptime\u547d\u4ee4\u7684\u7a97\u683c\u5728\u4e0b\u65b9\uff0c\u53ea\u9700\u8981\u5728\u8be5\u7a97\u683c\u4e2d\u6267\u884c\u201ctmux swap-pane -U\u201d\u547d\u4ee4\u5373\u53ef\u4e0e\u4e0a\u65b9\u7a97\u683c\u4e92\u6362\u4f4d\u7f6e\uff0c\u6548\u679c\u5982\u56fe9-24\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-23 \u5207\u6362\u7a97\u683c\u4f4d\u7f6e\u524d<\/p>\n

\"\"
\n\u56fe9-24 \u5207\u6362\u7a97\u683c\u4f4d\u7f6e\u540e<\/p>\n

\u5728\u5de5\u4f5c\u4e2d\uff0c\u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u5207\u6362\u7a97\u683c\u96be\u514d\u6709\u4e9b\u9ebb\u70e6\uff0c\u5b9e\u9645\u4e0aTmux\u670d\u52a1\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u5feb\u6377\u952e\u6765\u6267\u884c\u7a97\u683c\u7684\u5207\u6362\u3002\u65b9\u6cd5\u662f\u5148\u540c\u65f6\u6309\u4e0bCtrl+B\u7ec4\u5408\u952e\uff0c\u7136\u540e\u677e\u624b\u540e\u518d\u8fc5\u901f\u6309\u4e0b\u5176\u4ed6\u540e\u7eed\u6309\u952e\uff0c\u800c\u4e0d\u662f\u4e00\u8d77\u6309\u4e0b\u3002\u7528\u4e8e\u64cd\u4f5c\u4f1a\u8bdd\u7a97\u683c\u7684\u5e38\u89c1\u5feb\u6377\u952e\u5982\u88689-6 \u6240\u793a\u3002<\/p>\n

\u88689-6\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Tmux\u4f1a\u8bdd\u7a97\u683c\u76f8\u5173\u7684\u5e38\u7528\u5feb\u6377\u952e<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n
\u5feb\u6377\u952e<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
%<\/td>\n\u5212\u5206\u5de6\u53f3\u4e24\u4e2a\u7a97\u683c<\/td>\n<\/tr>\n
\"<\/td>\n\u5212\u5206\u4e0a\u4e0b\u4e24\u4e2a\u7a97\u683c<\/td>\n<\/tr>\n
;<\/td>\n\u5207\u6362\u81f3\u4e0a\u4e00\u4e2a\u7a97\u683c<\/td>\n<\/tr>\n
o<\/td>\n\u5207\u6362\u81f3\u4e0b\u4e00\u4e2a\u7a97\u683c<\/td>\n<\/tr>\n
{<\/td>\n\u5c06\u5f53\u524d\u7a97\u683c\u4e0e\u4e0a\u4e00\u4e2a\u7a97\u683c\u4f4d\u7f6e\u4e92\u6362<\/td>\n<\/tr>\n
}<\/td>\n\u5c06\u5f53\u524d\u7a97\u683c\u4e0e\u4e0b\u4e00\u4e2a\u7a97\u683c\u4f4d\u7f6e\u4e92\u6362<\/td>\n<\/tr>\n
x<\/td>\n\u5173\u95ed\u7a97\u683c<\/td>\n<\/tr>\n
!<\/td>\n\u5c06\u5f53\u524d\u7a97\u683c\u62c6\u5206\u6210\u72ec\u7acb\u7a97\u53e3<\/td>\n<\/tr>\n
q<\/td>\n\u663e\u793a\u7a97\u683c\u7f16\u53f7<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u8bf7\u5927\u5bb6\u4e00\u5b9a\u8981\u6ce8\u610f\uff0c\u5728\u901a\u8fc7\u5feb\u6377\u952e\u6765\u64cd\u4f5c\u4f1a\u8bdd\u7a97\u683c\u65f6\uff0c\u4e00\u5b9a\u662f\u5148\u6309\u4e0bCtrl+B\u7ec4\u5408\u952e\u540e\uff0c\u518d\u6572\u51fb\u5176\u4ed6\u6309\u952e\uff0c\u5426\u5219\u64cd\u4f5c\u4e0d\u751f\u6548\u3002\u5047\u8bbe\u73b0\u5728\u6709\u5982\u56fe9-25\u6240\u793a\u7684\u4e24\u4e2a\u7a97\u683c\uff0c\u6211\u4eec\u60f3\u5c06\u8fd9\u4e24\u4e2a\u7a97\u53e3\u7684\u4f4d\u7f6e\u4e92\u6362\u3002\u64cd\u4f5c\u65b9\u6cd5\u662f\u5148\u540c\u65f6\u6309\u4e0bCtrl+B\u7ec4\u5408\u952e\uff0c\u7136\u540e\u677e\u624b\uff0c\u518d\u6309\u4e0b\u201c}\u201d\u952e\uff0c\u5373\u53ef\u5b9e\u73b0\uff0c\u6700\u7ec8\u6548\u679c\u5982\u56fe9-26\u6240\u793a\u3002<\/p>\n

\u5728\u5b66\u4f1a\u4e86Tmux\u670d\u52a1\u7684\u8fd9\u4e9b\u64cd\u4f5c\u4e4b\u540e\uff0c\u65e5\u5e38\u7ba1\u7406\u5c31\u4e0d\u6210\u95ee\u9898\u4e86\u3002\u8fd9\u91cc\u63d0\u53ca\u7684\u547d\u4ee4\u548c\u5feb\u6377\u952e\u4e0d\u5efa\u8bae\u6b7b\u8bb0\u786c\u80cc\uff0c\u5de5\u4f5c\u65f6\u53ef\u4ee5\u628a\u4e66\u653e\u5728\u6848\u5934\uff0c\u968f\u7528\u968f\u67e5\u5373\u53ef\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-25 \u7a97\u683c\u4e92\u6362\u524d<\/p>\n

\"\"<\/p>\n

\u56fe9-26 \u7a97\u683c\u4e92\u6362\u540e<\/p>\n

9.3.3 \u4f1a\u8bdd\u5171\u4eab\u529f\u80fd<\/span><\/strong><\/h6>\n

Tmux\u670d\u52a1\u4e0d\u4ec5\u53ef\u4ee5\u786e\u4fdd\u7528\u6237\u5728\u6781\u7aef\u60c5\u51b5\u4e0b\u4e5f\u4e0d\u4e22\u5931\u5bf9\u7cfb\u7edf\u7684\u8fdc\u7a0b\u63a7\u5236\uff0c\u4fdd\u8bc1\u4e86\u751f\u4ea7\u73af\u5883\u4e2d\u8fdc\u7a0b\u5de5\u4f5c\u7684\u4e0d\u95f4\u65ad\u6027\uff0c\u800c\u4e14\u5b83\u8fd8\u5177\u6709\u4f1a\u8bdd\u5171\u4eab\u3001\u5206\u5c4f\u5207\u5272\u7a97\u683c\u3001\u4f1a\u8bdd\u9501\u5b9a\u7b49\u5b9e\u7528\u7684\u529f\u80fd\u3002\u5176\u4e2d\uff0c\u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\u662f\u4e00\u4ef6\u5f88\u9177\u7684\u4e8b\u60c5\uff0c\u5f53\u591a\u4e2a\u7528\u6237\u540c\u65f6\u63a7\u5236\u670d\u52a1\u5668\u7684\u65f6\u5019\uff0c\u5b83\u53ef\u4ee5\u628a\u670d\u52a1\u5668\u5c4f\u5e55\u5185\u5bb9\u5171\u4eab\u51fa\u6765\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6bcf\u4e2a\u7528\u6237\u90fd\u80fd\u591f\u770b\u5230\u76f8\u540c\u7684\u5185\u5bb9\uff0c\u8fd8\u80fd\u4e00\u8d77\u540c\u65f6\u64cd\u4f5c\u3002\u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\u7684\u6280\u672f\u62d3\u6251\u5982\u56fe9-27\u6240\u793a\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-27\u00a0 \u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\u6280\u672f\u62d3\u6251<\/p>\n

\u8981\u5b9e\u73b0\u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\uff0c\u9996\u5148\u4f7f\u7528ssh\u670d\u52a1\u5c06\u5ba2\u6237\u7aefA\u8fdc\u7a0b\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u968f\u540e\u4f7f\u7528Tmux\u670d\u52a1\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u4f1a\u8bdd\u7a97\u53e3\uff0c\u540d\u79f0\u4e3ashare\uff1a<\/p>\n

[root@client A ~]# ssh 192.168.10.10\r\nThe authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.\r\nECDSA key fingerprint is SHA256:5d52kZi1la\/FJK4v4jibLBZhLqzGqbJAskZiME6ZXpQ.\r\nAre you sure you want to continue connecting (yes\/no)? yes<\/strong>\r\nWarning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.\r\nroot@192.168.10.10's password: \u6b64\u5904\u8f93\u5165\u670d\u52a1\u5668\u7ba1\u7406\u5458\u5bc6\u7801<\/strong>\r\nActivate the web console with: systemctl enable --now cockpit.socket\r\n\r\nLast login: Fri Jul 24 06:26:58 2020\r\n[root@client A ~]# tmux new -s share\r\n<\/pre>\n

\u7136\u540e\uff0c\u4f7f\u7528ssh\u670d\u52a1\u5c06\u5ba2\u6237\u7aefB\u4e5f\u8fdc\u7a0b\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u5e76\u6267\u884c\u83b7\u53d6\u8fdc\u7a0b\u4f1a\u8bdd\u7684\u547d\u4ee4\u3002\u63a5\u4e0b\u6765\uff0c\u4e24\u53f0\u5ba2\u6237\u7aef\u5c31\u80fd\u770b\u5230\u76f8\u540c\u7684\u5185\u5bb9\u4e86\u3002<\/p>\n

[root@client B ~]# ssh 192.168.10.10\r\nThe authenticity of host '192.168.10.10 (192.168.10.10)' can't be established.\r\nECDSA key fingerprint is SHA256:5d52kZi1la\/FJK4v4jibLBZhLqzGqbJAskZiME6ZXpQ.\r\nAre you sure you want to continue connecting (yes\/no)? yes<\/strong>\r\nWarning: Permanently added '192.168.10.10' (ECDSA) to the list of known hosts.\r\nroot@192.168.10.10's password: \u6b64\u5904\u8f93\u5165\u670d\u52a1\u5668\u7ba1\u7406\u5458\u5bc6\u7801<\/strong>\r\nActivate the web console with: systemctl enable --now cockpit.socket\r\n\r\nLast login: Fri Jul 24 06:26:58 2020\r\n[root@client B ~]# tmux attach-session -t share<\/pre>\n

\u64cd\u4f5c\u5b8c\u6210\u540e\uff0c\u4e24\u53f0\u5ba2\u6237\u7aef\u7684\u6240\u6709\u7ec8\u7aef\u4fe1\u606f\u90fd\u4f1a\u88ab\u5b9e\u65f6\u540c\u6b65\uff0c\u5b83\u4eec\u53ef\u4ee5\u4e00\u8d77\u5171\u4eab\u540c\u4e00\u4e2a\u4f1a\u8bdd\u7a97\u53e3\uff0c\u7279\u522b\u65b9\u4fbf\u3002\u4e3a\u4e86\u8ba9\u5927\u5bb6\u66f4\u597d\u5730\u611f\u53d7\u4f1a\u8bdd\u5171\u4eab\u529f\u80fd\u7684\u5f3a\u5927\u4e4b\u5904\uff0c\u8bfb\u8005\u53ef\u4ee5\u4ece\u4e24\u53f0\u4e0d\u540c\u7684\u5ba2\u6237\u7aef\u540c\u65f6\u8fdc\u7a0b\u63a7\u5236\u5230\u670d\u52a1\u5668\u4e0a\u9762\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u5728\u540c\u4e00\u53f0\u7535\u8111\u4e0a\u521b\u5efa\u51fa\u4e24\u4e2a\u7a97\u683c\uff08\u89c1\u56fe9-28\uff09\u6765\u6a21\u62df\u8fd9\u4e00\u884c\u4e3a\uff0c\u66f4\u80fd\u6e05\u6670\u5730\u770b\u5230\u6570\u636e\u88ab\u540c\u6b65\u7684\u8fc7\u7a0b\u3002<\/p>\n

\"\"<\/p>\n

\u56fe9-28 \u7ec8\u7aef\u754c\u9762\u8fdb\u884c\u4f1a\u8bdd\u540c\u6b65<\/p>\n

9.4 \u68c0\u7d22\u65e5\u5fd7\u4fe1\u606f<\/strong><\/span><\/h5>\n

Linux\u7cfb\u7edf\u62e5\u6709\u5341\u5206\u5f3a\u5927\u4e14\u7075\u6d3b\u7684\u65e5\u5fd7\u7cfb\u7edf\uff0c\u7528\u4e8e\u4fdd\u5b58\u51e0\u4e4e\u6240\u6709\u7684\u64cd\u4f5c\u8bb0\u5f55\u548c\u670d\u52a1\u8fd0\u884c\u72b6\u6001\uff0c\u5e76\u4e14\u6309\u7167\u201c\u62a5\u9519\u201d\u201c\u8b66\u544a\u201d\u201c\u63d0\u793a\u201d\u548c\u201c\u5176\u4ed6\u201d\u7b49\u6807\u6ce8\u8fdb\u884c\u4e86\u5206\u7c7b\u3002\u8fd0\u7ef4\u7ba1\u7406\u5458\u53ef\u4ee5\u6839\u636e\u6240\u9700\u7684\u4fe1\u606f\u8fdb\u884c\u68c0\u7d22\uff0c\u5feb\u901f\u627e\u51fa\u60f3\u8981\u7684\u4fe1\u606f\uff0c\u56e0\u6b64\u5bf9\u4e8e\u4e86\u89e3\u7cfb\u7edf\u8fd0\u884c\u72b6\u6001\u6709\u7740\u4e0d\u9519\u7684\u5e2e\u52a9\u4f5c\u7528\u3002<\/p>\n

\u5728RHEL 8\u7cfb\u7edf\u4e2d\uff0c\u9ed8\u8ba4\u7684\u65e5\u5fd7\u670d\u52a1\u7a0b\u5e8f\u662frsyslog\u3002\u53ef\u4ee5\u5c06rsyslog\u7406\u89e3\u6210\u4e4b\u524d\u7684syslogd\u670d\u52a1\u7684\u589e\u5f3a\u7248\u672c\uff0c\u5b83\u66f4\u52a0\u6ce8\u91cd\u65e5\u5fd7\u7684\u5b89\u5168\u6027\u548c\u6027\u80fd\u6307\u6807\u3002\u4e3a\u4e86\u4fbf\u4e8e\u65e5\u540e\u7684\u68c0\u7d22\uff0c\u4e0d\u540c\u7684\u65e5\u5fd7\u4fe1\u606f\u4f1a\u88ab\u5199\u5165\u5230\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5e38\u89c1\u7684\u65e5\u5fd7\u6587\u4ef6\u5982\u88689-7\u6240\u793a\u3002<\/p>\n

\u88689-7\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5e38\u89c1\u7684\u65e5\u5fd7\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84<\/p>\n\n\n\n\n\n\n\n\n\n
\u6587\u4ef6\u8def\u5f84\u53ca\u547d\u4ee4<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
\/var\/log\/boot.log<\/td>\n\u7cfb\u7edf\u5f00\u673a\u81ea\u68c0\u4e8b\u4ef6\u53ca\u5f15\u5bfc\u8fc7\u7a0b\u7b49\u4fe1\u606f<\/td>\n<\/tr>\n
\/var\/log\/lastlog<\/td>\n\u7528\u6237\u767b\u5f55\u6210\u529f\u65f6\u95f4\u3001\u7ec8\u7aef\u540d\u79f0\u53caIP\u5730\u5740\u7b49\u4fe1\u606f<\/td>\n<\/tr>\n
\/var\/log\/btmp<\/td>\n\u8bb0\u5f55\u767b\u5f55\u5931\u8d25\u7684\u65f6\u95f4\u3001\u7ec8\u7aef\u540d\u79f0\u53caIP\u5730\u5740\u7b49\u4fe1\u606f<\/td>\n<\/tr>\n
\/var\/log\/messages <\/td>\n\u7cfb\u7edf\u53ca\u5404\u4e2a\u670d\u52a1\u7684\u8fd0\u884c\u548c\u62a5\u9519\u4fe1\u606f<\/td>\n<\/tr>\n
\/var\/log\/secure<\/td>\n\u7cfb\u7edf\u5b89\u5168\u76f8\u5173\u7684\u4fe1\u606f<\/td>\n<\/tr>\n
\/var\/log\/wtmp<\/td>\n\u7cfb\u7edf\u542f\u52a8\u4e0e\u5173\u673a\u7b49\u76f8\u5173\u4fe1\u606f<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5728\u65e5\u5e38\u5de5\u4f5c\u4e2d\uff0c\/var\/log\/message\u8fd9\u4e2a\u7efc\u5408\u6027\u7684\u6587\u4ef6\u7528\u5f97\u6700\u591a\u3002\u5728\u5904\u7406Linux\u7cfb\u7edf\u4e2d\u51fa\u73b0\u7684\u5404\u79cd\u6545\u969c\u65f6\uff0c\u4e00\u822c\u662f\u6700\u5148\u53d1\u73b0\u6545\u969c\u7684\u75c7\u72b6\uff0c\u800c\u627e\u5230\u6545\u969c\u7684\u539f\u56e0\u5219\u4e00\u5b9a\u79bb\u4e0d\u5f00\u65e5\u5fd7\u4fe1\u606f\u7684\u5e2e\u5fd9\u3002<\/p>\n

\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0c\u65e5\u5fd7\u6587\u4ef6\u5206\u4e3a\u4e0b\u97623\u79cd\u7c7b\u578b\u3002<\/p>\n

\u7cfb\u7edf\u65e5\u5fd7<\/strong>\uff1a\u4e3b\u8981\u8bb0\u5f55\u7cfb\u7edf\u7684\u8fd0\u884c\u60c5\u51b5\u548c\u5185\u6838\u4fe1\u606f\u3002<\/p>\n

\u7528\u6237\u65e5\u5fd7<\/strong>\uff1a\u4e3b\u8981\u8bb0\u5f55\u7528\u6237\u7684\u8bbf\u95ee\u4fe1\u606f\uff0c\u5305\u542b\u7528\u6237\u540d\u3001\u7ec8\u7aef\u540d\u79f0\u3001\u767b\u5165\u53ca\u9000\u51fa\u65f6\u95f4\u3001\u6765\u6e90IP\u5730\u5740\u548c\u6267\u884c\u8fc7\u7684\u64cd\u4f5c\u7b49\u3002<\/p>\n

\u7a0b\u5e8f\u65e5\u5fd7<\/strong>\uff1a\u7a0d\u5fae\u5927\u4e00\u4e9b\u7684\u670d\u52a1\u4e00\u822c\u90fd\u4f1a\u4fdd\u5b58\u4e00\u4efd\u4e0e\u5176\u540c\u540d\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u91cc\u9762\u8bb0\u5f55\u7740\u670d\u52a1\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u5404\u79cd\u4e8b\u4ef6\u7684\u4fe1\u606f\uff1b\u6bcf\u4e2a\u670d\u52a1\u7a0b\u5e8f\u90fd\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u4e14\u683c\u5f0f\u76f8\u5dee\u8f83\u5927\u3002<\/p><\/blockquote>\n

\u53ea\u6709\u5feb\u901f\u5730\u5b9a\u4f4d\u6545\u969c\u70b9\uff0c\u624d\u80fd\u5bf9\u75c7\u4e0b\u836f\uff0c\u53ca\u65f6\u89e3\u51b3\u5404\u79cd\u7cfb\u7edf\u95ee\u9898\u3002<\/p>\n

\u4e0a\u9762\u63d0\u5230\uff0c\u6bcf\u4e2a\u7a0d\u5fae\u5927\u4e00\u4e9b\u7684\u670d\u52a1\u90fd\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u65e5\u5fd7\u6587\u4ef6\uff0c\u4e3a\u4e86\u8ba9\u7528\u6237\u5728\u68c0\u7d22\u4fe1\u606f\u65f6\u4e0d\u81f3\u4e8e\u7279\u522b\u9ebb\u70e6\uff0cjournalctl\u547d\u4ee4\u5e94\u8fd0\u800c\u751f\u3002journalctl\u547d\u4ee4\u7528\u4e8e\u68c0\u7d22\u548c\u7ba1\u7406\u7cfb\u7edf\u65e5\u5fd7\u4fe1\u606f\uff0c\u82f1\u6587\u5168\u79f0\u4e3a\u201cjournal control\u201d\uff0c\u8bed\u6cd5\u683c\u5f0f\u4e3a\u201cjournalctl\u53c2\u6570\u201d\u3002\u5b83\u53ef\u4ee5\u6839\u636e\u4e8b\u4ef6\u3001\u7c7b\u578b\u3001\u670d\u52a1\u540d\u79f0\u7b49\u4fe1\u606f\u8fdb\u884c\u4fe1\u606f\u68c0\u7d22\uff0c\u4ece\u800c\u5927\u5927\u63d0\u9ad8\u4e86\u65e5\u5e38\u6392\u9519\u7684\u6548\u7387\u3002journalctl\u547d\u4ee4\u7684\u5e38\u89c1\u53c2\u6570\u5982\u88689-8\u6240\u793a\u3002\u5927\u5bb6\u53ef\u4ee5\u5148\u6df7\u4e2a\u8138\u719f\uff0c\u7136\u540e\u518d\u5f00\u59cb\u5b9e\u9a8c\u3002<\/p>\n

\u88689-7\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 journalctl\u547d\u4ee4\u4e2d\u5e38\u7528\u6309\u952e\u4ee5\u53ca\u4f5c\u7528<\/p>\n\n\n\n\n\n\n\n\n\n\n\n
\u53c2\u6570<\/td>\n\u4f5c\u7528<\/td>\n<\/tr>\n
-k<\/td>\n\u5185\u6838\u65e5\u5fd7<\/td>\n<\/tr>\n
-b<\/td>\n\u542f\u52a8\u65e5\u5fd7<\/td>\n<\/tr>\n
-u<\/td>\n\u6307\u5b9a\u670d\u52a1<\/td>\n<\/tr>\n
-n<\/td>\n\u6307\u5b9a\u6761\u6570<\/td>\n<\/tr>\n
-p<\/td>\n\u6307\u5b9a\u7c7b\u578b<\/td>\n<\/tr>\n
-f<\/td>\n\u5b9e\u65f6\u5237\u65b0\uff08\u8ffd\u8e2a\u65e5\u5fd7\uff09<\/td>\n<\/tr>\n
--since<\/td>\n\u6307\u5b9a\u65f6\u95f4<\/td>\n<\/tr>\n
--disk-usage<\/td>\n\u5360\u7528\u7a7a\u95f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u73b0\u5728\u51c6\u5907\u52a8\u624b\u52a8\u624b\u64cd\u7ec3\u8d77\u6765\uff01\u9996\u5148\u67e5\u770b\u7cfb\u7edf\u4e2d\u6700\u540e5\u6761\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl -n 5 \r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 13:39:51 CS>\r\nJan 31 13:33:54 localhost.localdomain systemd[1]: Started Fingerprint Authentic>\r\nJan 31 13:33:55 localhost.localdomain gnome-keyring-daemon[2533]: couldn't init>\r\nJan 31 13:33:55 localhost.localdomain gdm-password][4983]: gkr-pam: unlocked lo>\r\nJan 31 13:33:56 localhost.localdomain NetworkManager[1203]:   [1612071236>\r\nJan 31 13:39:51 localhost.localdomain cupsd[1230]: REQUEST localhost - - \"POST >\r\nlines 1-6\/6 (END)\r\n<\/pre>\n

\u8fd8\u53ef\u4ee5\u4f7f\u7528-f\u53c2\u6570\u5b9e\u65f6\u5237\u65b0\u65e5\u5fd7\u7684\u6700\u65b0\u5185\u5bb9\uff08\u8fd9\u4e0e\u7b2c2\u7ae0\u4ecb\u7ecd\u7684tail -f \/var\/log\/message\u547d\u4ee4\u7684\u6548\u679c\u76f8\u540c\uff09\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl -f \r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST. --\r\nJan 31 13:33:54 localhost.localdomain dbus-daemon[1058]: [system] Activating via systemd: service name='net.reactivated.Fprint' unit='fprintd.service' requested by ':1.172' (uid=0 pid=2600 comm=\"\/usr\/bin\/gnome-shell \" label=\"unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023\")\r\nJan 31 13:33:54 localhost.localdomain systemd[1]: Starting Fingerprint Authentication Daemon...\r\nJan 31 13:33:54 localhost.localdomain dbus-daemon[1058]: [system] Successfully activated service 'net.reactivated.Fprint'\r\nJan 31 13:33:54 localhost.localdomain systemd[1]: Started Fingerprint Authentication Daemon.\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u5728rsyslog\u670d\u52a1\u7a0b\u5e8f\u4e2d\uff0c\u65e5\u5fd7\u6839\u636e\u91cd\u8981\u7a0b\u5ea6\u88ab\u5206\u4e3a9\u4e2a\u7b49\u7ea7\uff0c\u5982\u88689-9\u6240\u793a\u3002\u8fd9\u6837\u7684\u597d\u5904\u662f\uff0c\u6211\u4eec\u53ef\u4ee5\u76f4\u51fb\u6700\u91cd\u8981\u7684\u4fe1\u606f\uff0c\u800c\u4e0d\u7528\u62c5\u5fc3\u4f1a\u88ab\u6d77\u5578\u822c\u7684\u8f93\u51fa\u5185\u5bb9\u6240\u6df9\u6ca1\u3002\u5927\u5bb6\u53ef\u4ee5\u5c06\u88689-9\u7559\u5b58\uff0c\u4ee5\u5907\u65e5\u540e\u5de5\u4f5c\u4e2d\u8fdb\u884c\u67e5\u9605\u3002<\/p>\n

\u88689-9\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u65e5\u5fd7\u4fe1\u606f\u767b\u8bb0\u5206\u7c7b<\/p>\n\n\n\n\n\n\n\n\n\n\n\n\n
\u65e5\u5fd7\u7b49\u7ea7<\/td>\n\u8bf4\u660e\u4ecb\u7ecd<\/td>\n<\/tr>\n
emerg<\/td>\n\u7cfb\u7edf\u51fa\u73b0\u4e25\u91cd\u6545\u969c\uff0c\u5185\u6838\u5d29\u6e83\u7b49\u60c5\u51b5<\/td>\n<\/tr>\n
alert<\/td>\n\u5e94\u7acb\u5373\u4fee\u590d\u7684\u6545\u969c\uff0c\u6570\u636e\u5e93\u635f\u574f\u7b49\u60c5\u51b5<\/td>\n<\/tr>\n
crit<\/td>\n\u5371\u9669\u8f83\u9ad8\u7684\u6545\u969c\uff0c\u786c\u76d8\u635f\u574f\u5bfc\u81f4\u7a0b\u5e8f\u8fd0\u884c\u5931\u8d25\u7684\u60c5\u51b5<\/td>\n<\/tr>\n
err<\/td>\n\u4e00\u822c\u5371\u9669\u7684\u6545\u969c\uff0c\u67d0\u4e2a\u670d\u52a1\u542f\u52a8\u6216\u8fd0\u884c\u5931\u8d25\u7684\u60c5\u51b5<\/td>\n<\/tr>\n
warning<\/td>\n\u8b66\u544a\u4fe1\u606f\uff0c\u67d0\u4e2a\u670d\u52a1\u53c2\u6570\u6216\u529f\u80fd\u9519\u8bef\u7684\u60c5\u51b5<\/td>\n<\/tr>\n
notice<\/td>\n\u4e00\u822c\u65e0\u5371\u9669\u7684\u6545\u969c\uff0c\u53ea\u662f\u9700\u8981\u5904\u7406\u7684\u60c5\u51b5<\/td>\n<\/tr>\n
info<\/td>\n\u901a\u7528\u6027\u6d88\u606f\uff0c\u7ed9\u7528\u6237\u63d0\u793a\u4e00\u4e9b\u6709\u7528\u4fe1\u606f<\/td>\n<\/tr>\n
debug<\/td>\n\u8c03\u8bd5\u7a0b\u5e8f\u6240\u4ea7\u751f\u7684\u4fe1\u606f<\/td>\n<\/tr>\n
none<\/td>\n\u6ca1\u6709\u4f18\u5148\u7ea7\uff0c\u4e0d\u505a\u65e5\u5fd7\u8bb0\u5f55<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

<\/p>\n

\u5982\u679c\u53ea\u60f3\u770b\u7cfb\u7edf\u4e2d\u8f83\u9ad8\u7ea7\u522b\u7684\u62a5\u9519\u4fe1\u606f\uff0c\u53ef\u4ee5\u5728journalctl\u547d\u4ee4\u4e2d\u7528-p\u53c2\u6570\u8fdb\u884c\u6307\u5b9a\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl -p crit\r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 15:06:07 CST. --\r\nJul 24 05:59:38 localhost.localdomain kernel: Detected CPU family 6 model 158 stepping 13\r\nJul 24 05:59:38 localhost.localdomain kernel: Warning: Intel Processor - this hardware has not undergone testing by Red Hat and might not be certified. Please consult https:\/\/hardware.redhat.com for certified hardware.\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u6211\u4eec\u4e0d\u4ec5\u80fd\u591f\u6839\u636e\u65e5\u5fd7\u7b49\u7ea7\u8fdb\u884c\u68c0\u7d22\uff0c\u8fd8\u53ef\u4ee5\u7528--since\u53c2\u6570\u6309\u7167\u4eca\u65e5\uff08today\uff09\u3001\u8fd1N<\/em>\u5c0f\u65f6\uff08hour\uff09\u3001\u6307\u5b9a\u65f6\u95f4\u8303\u56f4\u7684\u683c\u5f0f\u8fdb\u884c\u68c0\u7d22\uff0c\u627e\u51fa\u6700\u8fd1\u7684\u65e5\u5fd7\u6570\u636e\u3002\u6765\u770b\u4e0b\u9762\u51e0\u4e2a\u4f8b\u5b50\u3002<\/p>\n

\u4ec5\u67e5\u8be2\u4eca\u65e5\u7684\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl --since today\r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 15:10:01 CST. --\r\nJan 31 12:48:25 localhost.localdomain systemd[1]: Starting update of the root trust anchor >\r\nJan 31 12:48:25 localhost.localdomain rsyslogd[1392]: imjournal: sd_journal_get_cursor() fail>\r\nJan 31 12:48:25 localhost.localdomain rsyslogd[1392]: imjournal: journal reloaded... [v8.3>\r\nJan 31 12:48:25 localhost.localdomain systemd[1]: Started update of the root trust anchor for>\r\nJan 31 12:48:25 localhost.localdomain sssd[kcm][2764]: Shutting down\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u4ec5\u67e5\u8be2\u6700\u8fd11\u5c0f\u65f6\u7684\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl --since \"-1 hour\"\r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 15:10:01 CST. --\r\nJan 31 14:25:36 localhost.localdomain systemd[1]: Starting dnf makecache...\r\nJan 31 14:25:36 localhost.localdomain dnf[5516]: Updating Subscription Management repositories.\r\nJan 31 14:25:36 localhost.localdomain dnf[5516]: Unable to read consumer identity\r\nJan 31 14:25:36 localhost.localdomain dnf[5516]: This system is not registered to Red Hat>\r\nJan 31 14:25:36 localhost.localdomain dnf[5516]: Metadata cache refreshed recently.\r\nJan 31 14:25:36 localhost.localdomain systemd[1]: Started dnf makecache.\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u4ec5\u67e5\u8be212\u70b9\u6574\u523014\u70b9\u6574\u7684\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl --since \"12:00\" --until \"14:00\"\r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 15:10:01 CST. --\r\nJan 31 12:48:25 localhost.localdomain systemd[1]: Starting update of the root trust anchor>\r\nJan 31 12:48:25 localhost.localdomain rsyslogd[1392]: imjournal: sd_journal_get_cursor()>\r\nJan 31 12:48:25 localhost.localdomain rsyslogd[1392]: imjournal: journal reloaded... [v8.37>\r\nJan 31 12:48:25 localhost.localdomain systemd[1]: Started update of the root trust anchor>\r\nJan 31 12:48:25 localhost.localdomain sssd[kcm][2764]: Shutting down\r\nJan 31 12:48:30 localhost.localdomain systemd[1]: Starting SSSD Kerberos Cache Manager...\r\nJan 31 12:48:30 localhost.localdomain systemd[1]: Started SSSD Kerberos Cache Manager.\r\nJan 31 12:48:30 localhost.localdomain sssd[kcm][3981]: Starting up\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u4ec5\u67e5\u8be2\u4ece2020\u5e747\u67081\u65e5\u81f32020\u5e748\u67081\u65e5\u7684\u65e5\u5fd7\u4fe1\u606f\uff1a<\/p>\n

[root@linuxprobe ~]# journalctl --since \"2020-07-01\" --until \"2020-08-01\"\r\n-- Logs begin at Fri 2020-07-24 05:59:38 CST, end at Sun 2021-01-31 15:10:01 CST. --\r\nJul 24 05:59:38 localhost.localdomain kernel: Linux version 4.18.0-80.el8.x86_64 (mockbuild>\r\nJul 24 05:59:38 localhost.localdomain kernel: Command line: BOOT_IMAGE=(hd0,msdos1)\/vmlinuz>\r\nJul 24 05:59:38 localhost.localdomain kernel: Disabled fast string operations\r\nJul 24 05:59:38 localhost.localdomain kernel: x86\/fpu: Supporting XSAVE feature 0x001: 'x87>\r\nJul 24 05:59:38 localhost.localdomain kernel: x86\/fpu: Supporting XSAVE feature 0x002: 'SSE>\r\nJul 24 05:59:38 localhost.localdomain kernel: x86\/fpu: Supporting XSAVE feature 0x004: 'AVX>\r\nJul 24 05:59:38 localhost.localdomain kernel: x86\/fpu: xstate_offset[2]:  576, xstate_sizes>\r\nJul 24 05:59:38 localhost.localdomain kernel: x86\/fpu: Enabled xstate features 0x7, context>\r\nJul 24 05:59:38 localhost.localdomain kernel: BIOS-provided physical RAM map:\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026\r\n<\/pre>\n

\u4e0b\u9762\u6211\u4eec\u6765\u770b\u4e2a\u4e0d\u4e00\u6837\u7684\uff1a\u67e5\u8be2\u6307\u5b9a\u670d\u52a1\u7684\u65e5\u5fd7\u4fe1\u606f\u3002\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u6240\u6709\u7684\u65e5\u5fd7\u4fe1\u606f\u90fd\u662f\u6df7\u5728\u4e00\u8d77\u7684\u3002\u5982\u679c\u60f3\u770b\u5177\u4f53\u67d0\u9879\u670d\u52a1\u7684\u65e5\u5fd7\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528_SYSTEMD_UNIT\u53c2\u6570\u8fdb\u884c\u67e5\u8be2\uff0c\u670d\u52a1\u540d\u79f0\u7684\u540e\u9762\u8981\u6709\u201c.service\u201d\uff0c\u8fd9\u662f\u6807\u51c6\u670d\u52a1\u540d\u79f0\u7684\u5199\u6cd5\u3002<\/p>\n

[root@linuxprobe ~]# journalctl -u sshd\r\n-- Logs begin at Mon 2020-09-14 15:35:27 CST, end at Sun 2021-01-31 17:26:15 CST. --\r\nNov 09 13:50:03 iZuf61gqesu0zmrcsma8x4Z sshd[1218]: Server listening on 0.0.0.0 port 22.\r\nNov 09 13:58:45 iZuf61gqesu0zmrcsma8x4Z sshd[1218]: Received signal 15; terminating.\r\n-- Reboot --\r\nNov 09 13:59:29 iZuf61gqesu0zmrcsma8x4Z sshd[1127]: Server listening on 0.0.0.0 port 22.\r\nNov 09 14:12:12 iZuf61gqesu0zmrcsma8x4Z sshd[1262]: Accepted password for root from 111.196\r\nNov 09 14:12:12 iZuf61gqesu0zmrcsma8x4Z sshd[1262]: pam_unix(sshd:session): session opened\r\nNov 09 14:14:31 iZuf61gqesu0zmrcsma8x4Z sshd[1127]: Received signal 15; terminating.\r\n\u2026\u2026\u2026\u2026\u2026\u2026\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f\u2026\u2026\u2026\u2026\u2026\u2026<\/pre>\n

\u606d\u559c\u60a8\uff01\u53c8\u5b66\u4e60\u5b8c\u4e86\u4e00\u7ae0\u3002\u6309\u7167\u672c\u4e66\u5185\u5bb9\u7ed3\u6784\u7684\u5212\u5206\uff0c\u4ece\u7b2c10\u7ae0\u5f00\u59cb\u5c06\u4ecb\u7ecd\u5404\u79cd\u670d\u52a1\u7684\u914d\u7f6e\u65b9\u6cd5\u3002\u968f\u7740\u5b9e\u9a8c\u7684\u6210\u529f\uff0c\u76f8\u4fe1\u5927\u5bb6\u7684\u5b66\u4e60\u4e50\u8da3\u4e5f\u4f1a\u7ffb\u500d\u63d0\u5347\u3002\u4e00\u5b9a\u8981\u575a\u6301\u4e0b\u53bb\u54e6\uff01<\/p>\n

\u51fa\u73b0\u95ee\u9898?\u5927\u80c6\u63d0\u95ee!<\/strong><\/span><\/p>\n

\u56e0\u8bfb\u8005\u4eec\u786c\u4ef6\u4e0d\u540c\u6216\u64cd\u4f5c\u9519\u8bef\u90fd\u53ef\u80fd\u5bfc\u81f4\u5b9e\u9a8c\u914d\u7f6e\u51fa\u9519\uff0c\u8bf7\u8010\u5fc3\u518d\u4ed4\u7ec6\u770b\u770b\u64cd\u4f5c\u6b65\u9aa4\u5427\uff0c\u4e0d\u8981\u6c14\u9981~<\/p>\n

Linux\u6280\u672f\u4ea4\u6d41\u5b66\u4e60\u8bf7\u52a0\u8bfb\u8005\u7fa4\uff08\u63a8\u8350<\/span><\/strong>\uff09\uff1ahttps:\/\/lrxjmw.cn\/club<\/a><\/p>\n

*\u672c\u7fa4\u7279\u8272\uff1a\u786e\u4fdd\u6bcf\u4e00\u4f4d\u7fa4\u53cb\u90fd\u662f\u300aLinux\u5c31\u8be5\u8fd9\u4e48\u5b66\u300b\u7684\u8bfb\u8005\uff0c\u7b54\u7591\u66f4\u6709\u9488\u5bf9\u6027\uff0c\u4e0d\u5b9a\u671f\u9886\u53d6\u5b9a\u5236\u793c\u54c1\u3002<\/p><\/blockquote>\n

\u672c\u7ae0\u8282\u7684\u590d\u4e60\u4f5c\u4e1a<\/span>(\u7b54\u6848\u5c31\u5728\u95ee\u9898\u7684\u4e0b\u4e00\u884c\u54e6\uff0c\u7528\u9f20\u6807\u9009\u4e2d\u5373\u53ef\u770b\u5230\u7684~)<\/strong><\/span><\/p>\n

1\uff0e\u5728Linux\u7cfb\u7edf\u4e2d\u6709\u591a\u79cd\u65b9\u6cd5\u53ef\u4ee5\u914d\u7f6e\u7f51\u7edc\u53c2\u6570\uff0c\u8bf7\u5217\u4e3e\u51e0\u79cd\u3002<\/p>\n

\u7b54\uff1a<\/strong>\u914d\u7f6e\u7f51\u7edc\u53c2\u6570\u53ef\u4ee5\u4f7f\u7528nmtui\u547d\u4ee4\u3001nmcli\u547d\u4ee4\u3001nm-connection-editor\u547d\u4ee4\u6216\u8005\u76f4\u63a5\u7f16\u8f91\u7f51\u7edc\u914d\u7f6e\u6587\u4ef6\u6765\u5b9e\u73b0\u5bf9\u7f51\u7edc\u53c2\u6570\u7684\u4fee\u6539\u3002<\/span><\/p>\n

2\uff0e\u5728RHEL 8\u7cfb\u7edf\u4e2d\u4f7f\u7528\u7f51\u7edc\u4f1a\u8bdd\u6280\u672f\u7684\u76ee\u7684\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4f7f\u7528nmcli\u547d\u4ee4\u6765\u7ba1\u7406\u7f51\u7edc\u4f1a\u8bdd\u7684\u76ee\u7684\u662f\u4e3a\u4e86\u5feb\u901f\u5207\u6362\u7f51\u7edc\u53c2\u6570\uff0c\u4ee5\u4fbf\u9002\u5e94\u4e0d\u540c\u7684\u5de5\u4f5c\u573a\u666f\u3002<\/span><\/p>\n

3\uff0e\u8bf7\u7b80\u8ff0\u7f51\u5361\u7ed1\u5b9a\u6280\u672fbalaner-rr\u6a21\u5f0f\u7684\u7279\u70b9\u3002<\/p>\n

\u7b54\uff1a<\/strong>\u5e73\u65f6\u4e24\u5757\u7f51\u5361\u5747\u5de5\u4f5c\uff0c\u4e14\u81ea\u52a8\u5907\u63f4\uff0c\u65e0\u987b\u4ea4\u6362\u673a\u8bbe\u5907\u63d0\u4f9b\u8f85\u52a9\u652f\u6301\u3002<\/span><\/p>\n

4\uff0e\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u5f53\u901a\u8fc7\u4fee\u6539\u5176\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u53c2\u6570\u6765\u914d\u7f6e\u670d\u52a1\u7a0b\u5e8f\u65f6\uff0c\u82e5\u60f3\u8981\u8ba9\u65b0\u914d\u7f6e\u7684\u53c2\u6570\u751f\u6548\uff0c\u8fd8\u9700\u8981\u6267\u884c\u4ec0\u4e48\u64cd\u4f5c\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u9700\u8981\u91cd\u65b0\u542f\u52a8\u76f8\u5173\u7684\u670d\u52a1\u7a0b\u5e8f\uff0c\u6216\u8ba9\u670d\u52a1\u7a0b\u5e8f\u91cd\u65b0\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6\uff0c\u6216\u91cd\u542f\u7cfb\u7edf\u3002<\/span><\/p>\n

5\uff0esshd\u670d\u52a1\u7684\u5bc6\u7801\u9a8c\u8bc1\u4e0e\u5bc6\u94a5\u9a8c\u8bc1\u65b9\u5f0f\uff0c\u54ea\u4e2a\u66f4\u5b89\u5168\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u4e00\u822c\u60c5\u51b5\u4e0b\uff0c\u5bc6\u94a5\u9a8c\u8bc1\u65b9\u5f0f\u66f4\u52a0\u5b89\u5168\u3002\u82e5\u7528\u6237\u6709\u66f4\u9ad8\u7684\u5b89\u5168\u9700\u6c42\uff0c\u8fd8\u53ef\u4ee5\u518d\u5bf9\u5bc6\u94a5\u6587\u4ef6\u8fdb\u884c\u5bc6\u7801\u52a0\u5bc6\uff0c\u4ece\u800c\u5b9e\u73b0\u53cc\u91cd\u52a0\u5bc6\u3002<\/span><\/p>\n

6\uff0e\u00a0\u60f3\u8981\u628a\u672c\u5730\u6587\u4ef6\/root\/out.txt\u4f20\u9001\u5230\u5730\u5740\u4e3a192.168.10.20\u7684\u8fdc\u7a0b\u4e3b\u673a\u7684\/home\u76ee\u5f55\u4e0b\uff0c\u4e14\u672c\u5730\u4e3b\u673a\u4e0e\u8fdc\u7a0b\u4e3b\u673a\u5747\u4e3aLinux\u7cfb\u7edf\uff0c\u6700\u4e3a\u7b80\u4fbf\u7684\u4f20\u9001\u65b9\u5f0f\u662f\u4ec0\u4e48\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6267\u884c\u547d\u4ee4scp \/root\/out.txt root@192.168.10.20:\/home\uff0c\u5e76\u5728\u8fdb\u884c\u5bc6\u7801\u9a8c\u8bc1\u540e\u5373\u53ef\u5f00\u59cb\u4f20\u9001\u3002<\/span><\/p>\n

7\uff0eTmux\u670d\u52a1\u7a0b\u5e8f\u80fd\u591f\u8ba9\u7528\u6237\u5b9e\u73b0\u8fdc\u7a0b\u63a7\u5236\u7684\u4e0d\u95f4\u65ad\u4f1a\u8bdd\uff0c\u5373\u4fbf\u7f51\u7edc\u53d1\u751f\u4e2d\u65ad\u4e5f\u4e0d\u4e22\u5931\u5bf9\u8fdc\u7a0b\u4e3b\u673a\u7684\u4f1a\u8bdd\u63a7\u5236\u3002\u90a3\u4e48\uff0c\u5f53\u60f3\u8981\u6062\u590d\u4e00\u4e2a\u540d\u4e3alinux\u7684\u4f1a\u8bdd\u7a97\u53e3\u65f6\uff0c\u5e94\u8be5\u600e\u4e48\u505a\u5462\uff1f<\/p>\n

\u7b54\uff1a<\/strong>\u6267\u884c\u547d\u4ee4tmux attach -t linux\u5373\u53ef\u6062\u590d\u8fd9\u4e2a\u4f1a\u8bdd\u7a97\u53e3\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"

\u7ae0\u8282\u7b80\u8ff0\uff1a\u00a0 \u672c\u7ae0\u8bb2\u89e3\u4e86\u5982\u4f55\u4f7f\u7528nmtui\u547d\u4ee4\u914d\u7f6e\u7f51\u5361\u53c2\u6570\uff0c\u4ee5\u53ca\u901a\u8fc7nmcli\u547d\u4ee4\u67e5\u770b\u7f51\u7edc\u4fe1\u606f\u5e76\u7ba1\u7406\u7f51\u7edc\u4f1a\u8bdd\u670d […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[559],"tags":[],"class_list":["post-181460","post","type-post","status-publish","format-standard","hentry","category-rhel8"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=181460"}],"version-history":[{"count":107,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181460\/revisions"}],"predecessor-version":[{"id":275438,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/181460\/revisions\/275438"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=181460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=181460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=181460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}