{"id":173934,"date":"2020-03-16T10:48:19","date_gmt":"2020-03-16T02:48:19","guid":{"rendered":"https:\/\/gulass.cn\/?p=173934"},"modified":"2020-03-03T16:50:42","modified_gmt":"2020-03-03T08:50:42","slug":"bpf-teleport","status":"publish","type":"post","link":"https:\/\/gulass.cn\/bpf-teleport.html","title":{"rendered":"BPF\u5982\u4f55\u589e\u5f3aTeleport\u7684\u589e\u5f3a\u56de\u8bdd\u8bb0\u5f55\u529f\u80fd"},"content":{"rendered":"
\n\n\n\n
\u5bfc\u8bfb<\/td>\nTeleport\u662f\u4e00\u6b3eGolang\u8bed\u8a00\u5f00\u53d1\u7684\u7528\u6765\u66ff\u4ee3sshd\u7684ssh\u670d\u52a1\u5668\uff0c\u652f\u6301\u901a\u8fc7 SSH \u6216\u8005 HTTPS \u8fdc\u7a0b\u8bbf\u95ee\uff0c\u652f\u6301\u96c6\u7fa4\u3001Web\u767b\u9646\u3001SSH\u5386\u53f2\u8bb0\u5f55\u8fd8\u91cd\u653e\u7528\u4ee5\u64cd\u4f5c\u5206\u4eab\u548c\u5b89\u5168\u5ba1\u8ba1\uff0c\u57fa\u4e8eGolang ssh\u5305\u6784\u5efa\u5f00\u53d1\uff0c\u5b9e\u73b0\u5b8c\u5168\u517c\u5bb9OpenSSH\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n

\"\" \"\"<\/center>\u6700\u8fd1Teleport 4.2\u7248\u672c\u4e2d\u65b0\u589e\u52a0ssh\u589e\u5f3a\u7684\u56de\u8bdd\u8bb0\u5f55\u529f\u80fd\u7528\u6765\u63a5\u6536\u975e\u7ed3\u6784\u5316\u7684ssh\u4f1a\u8bdd\uff0c\u5e76\u5c06\u5176\u901a\u8fc7\u7ed3\u6784\u5316\u4e8b\u4ef6\u6d41\u6765\u8f93\u51fa\u3002\u8be5\u529f\u80fd\u4f7f\u7528\u5230\u4e86Linux\u5185\u6838\u4e2d\u96c6\u6210\u7684\u4e00\u9879\u65b0\u6280\u672feBPF(\u7b80\u79f0\u4e3aBPF)\u3002\u7528\u6765\u5b8c\u5584Teleport\u5ba1\u8ba1\u529f\u80fd\u7684\u4e0d\u8db3\u4e4b\u5904\u3002\u672c\u6587\u866b\u866b\u5c31\u7ed9\u5927\u5bb6\u4ecb\u7ecdTeleport\u4e2d\u662f\u5982\u4f55\u505a\u7684\u3002<\/p>\n
\u80cc\u666f<\/strong><\/div>\n

Teleport\u7684\u4e00\u4e2a\u4f18\u52bf\u5c31\u662f\uff0c\u53ef\u4ee5\u5bf9ssh\u4f1a\u8bdd\u5168\u7a0b\u8bb0\u5f55\u3002\u8be5\u529f\u80fd\u53ef\u4ee5\u6355\u83b7\u7528\u6237\u5c4f\u5e55\u4e0a\u663e\u793a\u7684\u6240\u6709\u5185\u5bb9\u3002\u4e4b\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528\u8be5\u8bb0\u5f55\u56de\u653e\u8fd8\u539f\u6240\u6709\u64cd\u4f5c\uff0c\u4ee5\u4fbf\u4e8e\u5ba1\u8ba1\u3002\u8fd9\u4e9b\u8bb0\u5f55\u6613\u4e8e\u7406\u89e3\uff0c\u5e76\u63d0\u4f9b\u4e86\u6709\u5173\u7528\u6237\u5728\u4f1a\u8bdd\u8fc7\u7a0b\u4e2d\u6240\u505a\u64cd\u4f5c\u548c\u663e\u793a\u7684\u4fe1\u606f<\/p>\n

\u7136\u800c\uff0c\u548c\u5176\u4ed6\u540c\u7c7b\u5de5\u5177\u4e00\u6837(\u5821\u5792\u673a)\uff0cTeleport\u4e5f\u6709\u4e0d\u8db3\u4e4b\u5904\uff0c\u7528\u6237\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u65b9\u6cd5\u7ed5\u8fc7\u4f1a\u8bdd\u8bb0\u5f55\u3002\u5176\u4e2d\u5305\u62ec\uff1a<\/p>\n

\u6df7\u6dc6\u547d\u4ee4\uff1a<\/p>\n

\u6bd4\u5982\u901a\u8fc7\u52a0\u5bc6\u6216\u8005\u5176\u4ed6\u65b9\u5f0f\u5bf9\u547d\u4ee4\u4e88\u4ee5\u6df7\u6dc6\u3002\u6bd4\u5982\u4e0b\u9762\u7684\u8bed\u53e5\uff0c\u7528base64\u7f16\u7801\u5bf9\u8981\u6267\u884c\u7684\u547d\u4ee4\u8fdb\u884c\u4e86\u6df7\u6dc6\u3002<\/p>\n

echo Y3VybCBodHRwOi8vd3d3LmV4YW1wbGUuY29tCg== | base64 -d | sh<\/pre>\n

\u8fd9\u6837\u5b9e\u9645\u7684\u6267\u884c\u547d\u4ee4(curl example.com)\u4e0d\u4f1a\u76f4\u63a5\u88ab\u8bb0\u5f55\u3002<\/p>\n

Shell\u811a\u672c\uff1a<\/p>\n

\u5982\u679c\u7528\u6237\u901a\u8fc7\u4e0a\u4f20\u5e76\u6267\u884c\u811a\u672c\u7684\u65b9\u5f0f\uff0c\u4e5f\u4e0d\u80fd\u6355\u83b7\u811a\u672c\u4e2d\u8fd0\u884c\u7684\u547d\u4ee4\uff0c\u53ea\u80fd\u6355\u83b7\u811a\u672c\u7684\u8f93\u51fa\u3002<\/p>\n

\u7ec8\u7aef\u63a7\u5236\uff1a<\/p>\n

ssh\u7ec8\u7aef\u53ef\u4ee5\u652f\u6301\u591a\u79cd\u63a7\u4ef6\uff0c\u6bd4\u5982\u7528\u6237\u53ef\u4ee5\u7981\u7528\u7ec8\u7aef\u56de\u663e\u7684\u63a7\u4ef6\uff0c\u5728\u4e00\u4e9b\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u4f1a\u4f7f\u7528\u3002\u4f8b\u5982sudo\u547d\u4ee4\u5f53\u5b83\u4eec\u63d0\u793a\u7528\u6237\u8f93\u5165\u5bc6\u7801\u65f6\u3002\u8fd9\u662f\u4e5f\u4e0d\u80fd\u5728ssh\u8bb0\u5f55\u4e2d\u6355\u83b7\u5b83\u4eec\u3002<\/p>\n

\u6b64\u5916\uff0c\u7531\u4e8eTTY\u6d41\u662f\u975e\u7ed3\u6784\u5316\u6027\u8d28\uff0c\u4f1a\u8bdd\u8bb0\u5f55\u5728\u67d0\u79cd\u7a0b\u5ea6\u4e0a\u53ef\u80fd\u96be\u4ee5\u6355\u83b7\u548c\u76d1\u89c6\u3002<\/p>\n

\u6280\u672f\u5b9e\u73b0<\/strong><\/div>\n

\u4e3a\u4e86\u89e3\u51b3\u5b89\u5168\u5ba1\u8ba1\u7684\u8fd9\u4e9b\u4e0d\u8db3\uff0cTeleport\u9700\u8981\u4e00\u79cd\u80fd\u5c06\u975e\u7ed3\u6784\u5316ssh\u4f1a\u8bdd\u8f6c\u6362\u4e3a\u7ed3\u6784\u5316\u4e8b\u4ef6\u6d41\u7684\u65b9\u6cd5\u3002\u8fd9\u5c31\u662f\u672c\u6587\u8981\u8bf4\u7684\u589e\u5f3a\u56de\u8bdd\u8bb0\u5f55\u529f\u80fd\uff0c\u5177\u4f53\u529f\u80fd\u5c55\u793a\u5982\u4e0b\uff1a<\/p>\n

\"\"<\/center><\/p>\n
\u6280\u672f\u9009\u578b<\/strong><\/div>\n

\u901a\u8fc7\u591a\u79cd\u65b9\u6cd5\u5bf9\u6bd4\uff0c\u5305\u62ec\u4e86\u5185\u5bb9\u4ece\u6b63\u5219\u8868\u8fbe\u5f0f\u6a21\u5f0f\u5339\u914d\u4e4b\u7c7b\u7684\u4e34\u65f6\u65b9\u6cd5\u5230\u81ea\u5df1\u89e3\u6790\u539f\u59cbSSH\u4f1a\u8bdd\u4e4b\u7c7b\u7684\u65b9\u6cd5\uff0c\u8fd8\u63a2\u7d22\u4e86Linux\u63d0\u4f9b\u7684\u5404\u79cdAPI\u548c\u7cfb\u7edf\uff0c\u4f8b\u5982Audit\uff0cfanotify\u548cBPF\u7b49\uff0c\u5728\u8d70\u6280\u672f\u5bf9\u6bd4\u65f6\u5019\uff0c\u8981\u8003\u8651\u7684\u4e24\u4e2a\u6807\u51c6\u662f\u51c6\u786e\u6027\u548c\u6027\u80fd\u95ee\u9898\uff1a<\/p>\n

\u51cf\u5c11\u8bef\u62a5\uff0c\u6700\u597d\u51cf\u5c11\u5230\u96f6\u3002\u76d1\u63a7\u7cfb\u7edf(\u5b89\u5168\u5ba1\u8ba1)\uff0c\u9996\u5148\u8981\u8003\u8651\u662f\u7684\u51c6\u786e\u6027\u95ee\u9898\uff0c\u5982\u679c\u62a5\u8b66\u5f88\u591a\uff0c\u5219\u5bf9\u8b66\u62a5\u7684\u5173\u6ce8\u5ea6\u5c31\u4f1a\u51cf\u5c11\u3002\u53ef\u80fd\u4f1a\u5bfc\u81f4\u4e25\u91cd\u95ee\u9898\u88ab\u5ffd\u7565\u6389\u3002<\/p>\n

\u51cf\u5c11\u7531\u76d1\u63a7\u5f15\u8d77\u7684\u4efb\u4f55\u6027\u80fd\u5f71\u54cd\uff0c\u6700\u597d\u4e3a\u96f6\u3002\u76d1\u63a7\u7cfb\u7edf\u8981\u5c3d\u91cf\u907f\u514d\u5f71\u54cd\u7cfb\u7edf\u7684\u6027\u80fd\u3002<\/p>\n

\u591a\u79cd\u65b9\u6cd5\u4e2d\uff0c\u8bef\u62a5\u95ee\u9898\u90fd\u5f88\u4e25\u91cd\u3002\u65e0\u6cd5\u5bf9\u6784\u6210SSH\u4f1a\u8bdd\u7684\u5b57\u8282\u6d41\u8fdb\u884c\u51c6\u786e\u7684\u89e3\u6790\u548c\u89e3\u91ca\uff0c\u4e0d\u80fd\u9632\u6b62\u8b66\u62a5\u75b2\u52b3\u3002<\/p>\n

\u8fd8\u6709\u4e00\u4e9b\u65b9\u6cd5\uff0c\u4f1a\u6709\u6027\u80fd\u95ee\u9898\u3002\u6bd4\u5982Linux Audit\u3002<\/p>\n

\u901a\u8fc7\u67e5\u770b\u6587\u4ef6\u7cfb\u7edf\u8bbf\u95ee\uff0c\u6709\u4e00\u4e9b\u66ff\u4ee3\u65b9\u6cd5\u3002\u6700\u7a81\u51fa\u7684\u4e24\u4e2a\u662finotify\u548cfanotify\u3002inotify\u4e0d\u9519\uff0c\u505a\u4e3a\u4e86\u521d\u59cb\u5907\u9009\u9879\uff0c\u4f46\u662f\u5176\u7f3a\u5c11\u9012\u5f52\u76ee\u5f55\u76d1\u89c6\u529f\u3002fanotify\u66f4\u6709\u5e0c\u671b\uff0c\u4e5f\u5b58\u5728\u4e24\u4e2a\u95ee\u9898\u3002<\/p>\n

\u5e03\u4f26\u4e39.\u683c\u96f7\u683c\u5728BPF\u6027\u80fd\u5de5\u5177\u4e66\u4e2d\u63d0\u5230\uff0c\u5728\u91cd\u8d1f\u8f7d\u65f6\uff0copensnoop\u6bd4\u5bf9fanotify\uff0cfanotify \u5360\u4e8667%\u7684CPU\uff0c\u800copensnoop\u53ea\u7528\u52301%\u3002<\/p>\n

Linux\u5185\u6838\u6700\u8fd1\u5408\u5e76\u5230\u4e00\u4e2a\u8865\u4e01\uff0c\u4ee5\u63d0\u9ad8fanotify\u7684\u6027\u80fd\uff0c\u4f7f\u5176\u66f4\u9002\u5408\u4e8e\u5bf9\u6574\u4e2a\u6587\u4ef6\u7cfb\u7edf\u76d1\u89c6\uff0c\u8fd9\u6837\u53ef\u4ee5\u5728Teleport\u4e2d\u7684\u4f7f\u7528\u66f4\u52a0\u7d27\u5bc6\u5730\u5951\u5408\u3002\u7136\u800c\uff0c\u8865\u4e01\u9700\u8981\u5728Linux 5.1\u4e2d\u624d\u88ab\u5408\u5e76\uff0c\u76ee\u524d\u8fd8\u6ca1\u6709\u5f00\u7bb1\u5373\u7528\u7684\u4e3b\u6d41\u53d1\u884c\u7248\u652f\u6301\u3002<\/p>\n

\u8003\u8651\u5230\u8fd9\u4e9b\u8003\u8651\u56e0\u7d20\uff0cTeleport\u6700\u7ec8\u9009\u62e9\u4e86\u57fa\u4e8eBPF\u7a0b\u5e8f\u94fe\u6784\u5efa\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u8be5\u89e3\u51b3\u65b9\u6848\u51cf\u5c11\u4e86\u8bef\u62a5\u5e76\u4e14\u5bf9\u6027\u80fd\u7684\u5f71\u54cd\u6700\u5c0f\u3002<\/p>\n

BPF\u4ecb\u7ecd<\/strong><\/div>\n

BPF\uff0c\u539f\u672c\u662fUnix\u7684\u4e00\u4e2a\u5305\u8fc7\u6ee4\u5668\uff0c\u4f2f\u514b\u5229\u5305\u8fc7\u6ee4\u5668(Berkeley Packet Filter)\u3002\u540e\u6765\u88ab\u79fb\u690d\u5230\u4e86Linux\u4e2d\u30022013 \u5e74\uff0cAlexei Starovoitov \u5bf9 BPF \u505a\u5b8c\u5584\u548c\u6539\u8fdb\uff0c\u65b0\u7248\u672c\u88ab\u547d\u540d\u4e3a eBPF (extended BPF)\uff0c\u7b80\u5199\u4e3aBPF\uff0c\u800c\u5c06\u8001\u7684BPF\u53eb\u505acBPF(classic BPF)\u3002eBPF\u5728\u589e\u52a0\u4e86\u6620\u5c04\u548c\u5c3e\u8c03\u7528\u7b49\u65b0\u7279\u6027\uff0c\u5e76\u4e14\u8fd8\u91cd\u5199\u4e86JIT \u7f16\u8bd1\u5668\u3002\u65b0\u7248\u8bed\u8a00\u6bd4 cBPF \u66f4\u63a5\u8fd1\u539f\u751f\u673a\u5668\u8bed\u8a00\u3002BPF\u5141\u8bb8\u7528\u6237\u7a7a\u95f4\u7a0b\u5e8f\u4ee5\u5b89\u5168\u548c\u9ad8\u6548\u7684\u65b9\u5f0f\u4ece\u5185\u6838\u4e2d\u7684\u67d0\u4e9b\u4f4d\u7f6e\u6302\u63a5\u5e76\u53d1\u51fa\u4e8b\u4ef6\u3002<\/p>\n

\u5b89\u5168\u610f\u5473\u7740BPF\u7a0b\u5e8f\u4e0d\u4f1a\u9677\u5165\u65e0\u9650\u5faa\u73af\u800c\u5bfc\u81f4\u7cfb\u7edf\u762b\u75ea\u3002BPF\u7a0b\u5e8f\u4e0d\u592a\u53ef\u80fd\u50cf\u5185\u6838\u6a21\u5757\u4e00\u6837\u53ef\u80fd\u4f7f\u6574\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u5d29\u6e83\u3002<\/p>\n

BPF\u7a0b\u5e8f\u4e5f\u5f88\u6709\u6548\uff0c\u5982\u679c\u4e0d\u80fd\u8db3\u591f\u5feb\u5730\u4f7f\u7528\u5b83\u4eec\uff0c\u5219\u4e22\u5f03\u4e8b\u4ef6\uff0c\u800c\u4e0d\u662f\u62d6\u7d2f\u6574\u4e2a\u7cfb\u7edf\u7684\u6027\u80fd\u3002<\/p>\n

\u76ee\u524dLinux\u4e2d\u6709\u5927\u91cf\u7684\u7cfb\u7edf\u5de5\u5177\u90fd\u662f\u57fa\u4e8eBPF\u8fdb\u884c\u4e86\u91cd\u6784(\u6bd4\u5982iptables)\uff0c\u5e03\u4f26\u4e39.\u683c\u96f7\u683c\u7684\u4e66\u300aBPF\u9ad8\u6027\u80fd\u5de5\u5177\u300b\u4e2d(blog\u4e2d)\u4ecb\u7ecd\u4e86\u5927\u91cf\u7684\u5de5\u5177\u53ef\u4ee5\u4f9b\u5927\u5bb6\u5b66\u4e60\u3002<\/p>\n

Teleport\u5bf9\u63a5BPF<\/strong><\/div>\n

Teleport\u4e2d\u4f7f\u7528\u4e86\u4e09\u4e2aBPF\u7a0b\u5e8f\uff1aexecsnoop\u6355\u83b7\u7a0b\u5e8f\u6267\u884c\uff0copensnoop\u6355\u83b7\u7a0b\u5e8f\u6253\u5f00\u7684\u6587\u4ef6\uff0ctcpconnect\u6355\u83b7\u7a0b\u5e8f\u5efa\u7acb\u7684TCP\u8fde\u63a5\u3002<\/p>\n

\u4e3a\u4e86\u66f4\u597d\u5730\u7406\u89e3\u8fd9\u4e9bBPF\u7a0b\u5e8f\u7684\u529f\u80fd\uff0c\u53ef\u4ee5\u8fd0\u884c\u65f6\u67e5\u770bexecsnoop\u7684\u8f93\u51faman ls\u3002<\/p>\n

\u770b\u8d77\u6765\uff0c\u7b80\u5355\u5730\u8fd0\u884cman\u4e8c\u8fdb\u5236\u6587\u4ef6\u4f3c\u4e4e\u662f\u5728\u5e55\u540e\u6267\u884c\u4e86\u8bb8\u591a\u5176\u4ed6\u7a0b\u5e8f\u3002<\/p>\n

Teleport \u5c06\u8fd9\u4e9b\u7a0b\u5e8f\u5d4c\u5165\u5176\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\uff0c\u5e76\u4e14\u5728\u542f\u7528\"\u589e\u5f3a\u7684\u4f1a\u8bdd\u8bb0\u5f55\"\u529f\u80fd\u540e\uff0c\u5b83\u5c06\u751f\u6210\u5e76\u8fd0\u884c\u5b83\u4eec\u3002<\/p>\n

\"\"<\/center>\u8fd9\u4e9b\u7a0b\u5e8f\u672c\u8eab\u662f\u8c03\u8bd5\u548c\u8ddf\u8e2a\u7684\u51fa\u8272\u5de5\u5177\uff0c\u5b83\u80fd\u7ed9\u51fa\u7cfb\u7edf\u4e0a\u6b63\u5728\u6267\u884c\u4ec0\u4e48\u64cd\u4f5c\uff0c\u800c\u4e0d\u4ec5\u9650\u4e8e\u4e00\u4e2a\u7528\u6237\u3002<\/p>\n

\u8981\u5c06\u7a0b\u5e8f\u6267\u884c\u4e0e\u7279\u5b9a\u7684SSH\u4f1a\u8bdd\u76f8\u5173\u8054\uff0c\u8fd8\u4f7f\u7528\u4e86cgroups(\u5c24\u5176\u662fcgroupv2)\u3002Teleport\u542f\u52a8SSH\u4f1a\u8bdd\u65f6\uff0c\u5b83\u5c06\u9996\u5148\u91cd\u65b0\u542f\u52a8\u81ea\u8eab\u5e76\u5c06\u5176\u7f6e\u4e8ecgroup\u4e2d\u3002\u8fd9\u4e0d\u4ec5\u5141\u8bb8\u8be5\u8fdb\u7a0b\uff0c\u800c\u4e14\u53ef\u4ee5\u4f7f\u7528\u552f\u4e00ID\u8ddf\u8e2aTeleport\u542f\u52a8\u7684\u6240\u6709\u5c06\u6765\u8fdb\u7a0b\u3002Teleport\u8fd0\u884c\u7684BPF\u7a0b\u5e8f\u5df2\u66f4\u65b0\uff0c\u8fd8\u53ef\u4ee5\u53d1\u51fa\u6267\u884c\u5b83\u4eec\u7684\u7a0b\u5e8f\u7684cgroup ID\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5c06\u4e8b\u4ef6\u4e0e\u7279\u5b9a\u7684SSH\u4f1a\u8bdd\u548c\u8eab\u4efd\u76f8\u5173\u8054\u3002<\/p>\n

\u5c40\u9650\u6027<\/strong><\/div>\n

\u76ee\u524dTeleport\u6ca1\u6709\u5b8c\u6210\u589e\u5f3a\u7684\u4f1a\u8bdd\u8bb0\u5f55\u3002\u4ecd\u7136\u5b58\u5728\u4e00\u4e9b\u5dee\u8ddd\uff0c\u5c06\u4ee5\u540e\u7248\u672c\u89e3\u51b3\u3002<\/p>\n

\u503c\u5f97\u6307\u51fa\u7684\u662f\uff0c\u901a\u8fc7\u4f1a\u8bdd\u8bb0\u5f55\uff0cTeleport\u53ef\u4ee5\u6355\u83b7\u7531\u4e8e\u5176\u7279\u6743\u4f4d\u7f6e\u800c\u6784\u6210\u4f1a\u8bdd\u7684\u5b57\u8282\u6d41(\u5b57\u8282\u6d41\u5fc5\u987b\u6d41\u8fc7Teleport)\u3002\u81f3\u5173\u91cd\u8981\u7684\u662f\uff0c\u4f1a\u8bdd\u8bb0\u5f55\u7684\u5b8c\u6574\u6027\u4e0d\u4f9d\u8d56\u4e8e\u4e3b\u673a\u81ea\u5df1\u62a5\u544a\u7684\u4efb\u4f55\u4fe1\u606f\u3002\u4f46\u662f\uff0c\u589e\u5f3a\u7684\u5ba1\u6838\u529f\u80fd\u4f9d\u8d56\u4e8e\u4e3b\u673a\u51c6\u786e\u5730\u5411Teleport\u62a5\u544a\u4fe1\u606f\u3002\u5982\u679c\u4e3b\u673a\u7684\u5b8c\u6574\u6027\u53d7\u5230\u635f\u5bb3\uff0c\u5219\u589e\u5f3a\u5ba1\u6838\u7684\u5b8c\u6574\u6027\u4e5f\u4f1a\u6536\u5230\u5f71\u54cd\u3002\u6b64\u5916\uff0cTeleport\u4ec5\u76d1\u63a7\u7cfb\u7edf\u4e2d\u6700\u5173\u952e\u7684\u90e8\u5206\u7cfb\u7edf\u8c03\u7528\uff0c\u800c\u4e0d\u662f\u5168\u90e8\u8c03\u7528\u3002<\/p>\n

\u76ee\u524d\uff0c\u589e\u5f3a\u7684\u4f1a\u8bdd\u8bb0\u5f55\u6700\u9002\u5408\u975eroot\u7528\u6237\uff0c\u5bf9\u6709\u6743\u8bbf\u95eeroot\u7684\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u591a\u79cd\u65b9\u5f0f\u7981\u7528\u589e\u5f3a\u4f1a\u8bdd\u8bb0\u5f55\u3002<\/p>\n

\u5b9e\u8df5<\/strong><\/div>\n

\u5728\u6ca1\u6709\u80cc\u666f\u7684\u60c5\u51b5\u4e0b\uff0c\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u811a\u672c\u8fdb\u884c\u589e\u5f3a\u7684\u4f1a\u8bdd\u8bb0\u5f55\u3002<\/p>\n

\"\"<\/center>\u9996\u5148\u542f\u52a8Ubuntu 19.04\u6216RHEL\/CentOS 8 VM\uff0c\u7136\u540e\u8fd0\u884c\u4e0a\u9762\u7684\u811a\u672c\u3002\u8be5\u811a\u672c\u4f1a\u5b89\u88c5\u5185\u6838\u5934\u6587\u4ef6\u548cbcc-tools\uff0c\u8fd9\u662f\u8fd0\u884c\u589e\u5f3a\u4f1a\u8bdd\u8bb0\u5f55\u7684\u5148\u51b3\u6761\u4ef6\u3002\u6b64\u5916\uff0c\u811a\u672c\u8fd8\u5b89\u88c5jq\uff0c\u4e00\u4e2a\u547d\u4ee4\u7684json\u89e3\u6790\u5de5\u5177(\u866b\u866b\u4ee5\u524d\u6587\u7ae0\u4ecb\u7ecd\u8fc7\uff0c\u53ef\u4ee5\u53c2\u8003)\uff0c\u8fd9\u6709\u52a9\u4e8e\u53ef\u89c6\u5316\u7ed3\u6784\u5316\u4e8b\u4ef6\u6d41\u3002<\/p>\n

\u6309\u7167\u8bf4\u660e\u8f93\u5165\u7ec8\u7aef\u540e\uff0c\u5c4f\u5e55\u4e0a\u770b\u5230\u4ee5\u4e0b\u7c7b\u4f3c\u7684\u4fe1\u606f\uff1a<\/p>\n

\"\"<\/center>\u7531\u6b64\u53ef\u89c1\uff0ccurl\u7a0b\u5e8f\u662f\u7531\u7528\u6237\u4ee5\u4e24\u79cd\u65b9\u5f0f\u6267\u884c\u7684\u3002\u9996\u5148\u662f\u7a0b\u5e8f\u672c\u8eab\u7684\u6267\u884c\u3002\u7b2c\u4e8c\u4e2a\u662f\u7a0b\u5e8f\u7684\u884c\u4e3a\uff0ccurl\u53d1\u51fa\u4e86\u7f51\u7edc\u8bf7\u6c42\uff0c\u4e5f\u53ef\u4ee5\u770b\u5230\u5b83\u3002\u4f60\u53ef\u4ee5\u5c1d\u8bd5\u6267\u884c\u5176\u4ed6\u64cd\u4f5c\uff0c\u4f8b\u5982\u6df7\u6dc6\u7684\u547d\u4ee4\uff0c\u6216\u8005\u811a\u672c\u65b9\u5f0f\u6267\u884c\u7b49\uff0c\u5e94\u8be5\u5728\u65e5\u5fd7\u4e2d\u67e5\u770b\u6267\u884c\u7ed3\u679c\u3002<\/p>\n
\u8981\u6c42<\/strong><\/div>\n

Teleport\u589e\u5f3a\u4f1a\u8bdd\u8bb0\u5f55\u7684\u6700\u4f4e\u8981\u6c42\u9700\u8981\u542f\u52a8BPF\u652f\u6301\u7684 Linux\u5185\u68384.18 \u3002\u76ee\u524d\u6709\u591a\u4e2a\u53d1\u884c\u7248\u672c\u53ef\u76f4\u63a5\u4f7f\u7528\u5b83\uff0c\u5305\u62ecUbuntu 19.04\uff0cDebian 10\u548cRHEL\/CentOS 8\u3002<\/p>\n

\u8fd8\u9700\u8981\u5b89\u88c5\u5185\u6838\u5934\u6587\u4ef6\u548cbcc-tools\u3002\u5bf9\u4e8e\u4e0a\u9762\u5217\u51fa\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u53d1\u884c\u7248\u7684\u5305\u7ba1\u7406\u5668\u4e2d\u5b89\u88c5\u5b83\u4eec\uff0c\u6bd4\u5982\u5bf9Centos 8\u53ea\u9700\u8fd0\u884c<\/p>\n

yum\u00a0install\u00a0-y\u00a0kernel-headers\u00a0bcc-tools<\/pre>\n

\u6216\u8005Ubuntu\u4e0b\u6267\u884c<\/p>\n

apt\u00a0install\u00a0-y\u00a0linux-headers-$(uname\u00a0-r)\u00a0bpfcc-tools<\/pre>\n

\u5982\u679c\u5c1a\u672a\u6253\u5305bcc-tools\uff0c\u5219\u5fc5\u987b\u4ece\u6e90\u4ee3\u7801\u6784\u5efa\u5b83\u4eec\u3002<\/p>\n

\u8981\u5728Teleport\u4e2d\u542f\u7528\u589e\u5f3a\u7684\u4f1a\u8bdd\u8bb0\u5f55\uff0c\u53ea\u9700\u5728\u6587\u4ef6\u914d\u7f6e\u4e2d\u5c06\u5176\u542f\u7528\u5373\u53ef\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

ssh_service:\r\nenhanced_recording:\r\nenabled: yes<\/pre>\n
\u7ed3\u8bba<\/strong><\/div>\n

\u5c3d\u7ba1\u6ca1\u6709\u4efb\u4f55\u76d1\u63a7\u7cfb\u7edf\u662f\u7edd\u5bf9\u53ef\u9760\u7684\uff0c\u4f46\u91c7\u7528\u5177\u6709\u591a\u79cd\u9632\u62a4\u63aa\u65bd\u7684\u7eb5\u6df1\u9632\u5fa1\u7b56\u7565\u53ef\u4ee5\u5e2e\u52a9\u53d1\u73b0\u95ee\u9898\u5e76\u91c7\u53d6\u9002\u5f53\u7684\u63aa\u65bd\u3002Teleport\u7684\u589e\u5f3a\u578b\u4f1a\u8bdd\u8bb0\u5f55\u529f\u80fd\u53ef\u4ee5\u4e3a\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u547d\u4ee4\u7684\u5b89\u5168\u5ba1\u8ba1\uff0c\u63d0\u4f9b\u66f4\u5f3a\u5927\u7684\u8bb0\u5f55\u548c\u64cd\u4f5c\u53ef\u89c1\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6700\u8fd1Teleport 4.2\u7248\u672c\u4e2d\u65b0\u589e\u52a0ssh\u589e\u5f3a\u7684\u56de\u8bdd\u8bb0\u5f55\u529f\u80fd\u7528\u6765\u63a5\u6536\u975e\u7ed3\u6784\u5316\u7684ssh\u4f1a\u8bdd\uff0c\u5e76\u5c06\u5176\u901a\u8fc7\u7ed3\u6784\u5316 […]<\/p>\n","protected":false},"author":323,"featured_media":173946,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-173934","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/173934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=173934"}],"version-history":[{"count":3,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/173934\/revisions"}],"predecessor-version":[{"id":173945,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/173934\/revisions\/173945"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/173946"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=173934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=173934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=173934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}