{"id":87510,"date":"2026-07-30T14:16:40","date_gmt":"2026-07-30T06:16:40","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/87510.html"},"modified":"2026-07-30T14:16:40","modified_gmt":"2026-07-30T06:16:40","slug":"ssh%e8%bf%9e%e6%8e%a5%e8%b6%85%e6%97%b6%e6%80%8e%e4%b9%88%e5%8a%9e%ef%bc%9fpytorch%e6%9c%8d%e5%8a%a1%e5%99%a8keepalive%e8%ae%be%e7%bd%ae","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/87510.html","title":{"rendered":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e"},"content":{"rendered":"<h2>SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e&#xff1f;PyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e<\/h2>\n<p>\u5728\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u7684\u65e5\u5e38\u5f00\u53d1\u4e2d&#xff0c;\u4f60\u662f\u5426\u7ecf\u5386\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u6a21\u578b\u6b63\u5728\u8bad\u7ec3BERT\u6216ResNet&#xff0c;\u7ec8\u7aef\u91cc\u65e5\u5fd7\u6b63\u7a33\u5b9a\u8f93\u51fa&#xff0c;\u4f60\u53bb\u6ce1\u4e86\u676f\u5496\u5561\u56de\u6765\u2014\u2014\u7ed3\u679c\u53d1\u73b0SSH\u8fde\u63a5\u5df2\u7ecf\u65ad\u5f00&#xff0c;\u7ec8\u7aef\u663e\u793a Write failed: Broken pipe\u3002\u867d\u7136\u8bad\u7ec3\u8fdb\u7a0b\u5176\u5b9e\u8fd8\u5728\u540e\u53f0\u8dd1\u7740&#xff08;\u7528 ps \u80fd\u67e5\u5230&#xff09;&#xff0c;\u4f46\u4f60\u518d\u4e5f\u770b\u4e0d\u5230\u5b9e\u65f6loss\u66f2\u7ebf&#xff0c;\u4e5f\u65e0\u6cd5\u4e2d\u9014\u8c03\u6574\u53c2\u6570\u3002<\/p>\n<p>\u8fd9\u4e0d\u662f\u4ee3\u7801\u7684\u95ee\u9898&#xff0c;\u4e5f\u4e0d\u662fGPU\u7f62\u5de5&#xff0c;\u800c\u662f\u5178\u578b\u7684SSH\u7a7a\u95f2\u8fde\u63a5\u88ab\u7f51\u7edc\u8bbe\u5907\u56de\u6536\u6240\u81f4\u3002\u5c24\u5176\u5728\u4f7f\u7528\u50cf PyTorch-CUDA-v2.6 \u8fd9\u7c7b\u5bb9\u5668\u5316\u955c\u50cf\u65f6&#xff0c;\u82e5\u672a\u9884\u8bbe\u8fde\u63a5\u4fdd\u6d3b\u673a\u5236&#xff0c;\u8fd9\u7c7b\u95ee\u9898\u4f1a\u9891\u7e41\u51fa\u73b0&#xff0c;\u4e25\u91cd\u5f71\u54cd\u8c03\u8bd5\u6548\u7387\u3002<\/p>\n<p>\u66f4\u9ebb\u70e6\u7684\u662f&#xff0c;\u5f88\u591a\u56e2\u961f\u76f4\u5230\u9879\u76ee\u4e2d\u671f\u624d\u610f\u8bc6\u5230\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6bcf\u6b21\u90fd\u8981\u9760 tmux \u6216 nohup \u8865\u6551&#xff0c;\u6cbb\u6807\u4e0d\u6cbb\u672c\u3002\u5176\u5b9e&#xff0c;\u771f\u6b63\u8be5\u505a\u7684&#xff0c;\u662f\u5728\u7cfb\u7edf\u5c42\u9762\u8ba9SSH\u201c\u81ea\u5df1\u8bf4\u8bdd\u201d&#xff0c;\u4e3b\u52a8\u7ef4\u6301\u5fc3\u8df3\u3002<\/p>\n<hr \/>\n<h4>\u4e3a\u4ec0\u4e48SSH\u4f1a\u7a81\u7136\u65ad\u5f00&#xff1f;<\/h4>\n<p>\u5f88\u591a\u4eba\u8bef\u4ee5\u4e3a\u662f\u670d\u52a1\u5668\u5d29\u6e83\u6216\u8005\u7a0b\u5e8f\u51fa\u9519&#xff0c;\u4f46\u5b9e\u9645\u4e0a&#xff0c;\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b&#xff0c;\u8fd9\u662fTCP\u534f\u8bae\u6808\u548c\u4e2d\u95f4\u7f51\u7edc\u8bbe\u65bd\u7684\u201c\u8282\u80fd\u7b56\u7565\u201d\u5728\u8d77\u4f5c\u7528\u3002<\/p>\n<p>SSH\u57fa\u4e8eTCP\u8fde\u63a5\u901a\u4fe1\u3002\u5f53\u7528\u6237\u957f\u65f6\u95f4\u6ca1\u6709\u8f93\u5165\u547d\u4ee4&#xff08;\u6bd4\u5982\u76ef\u7740\u8bad\u7ec3\u65e5\u5fd7\u53d1\u5446&#xff09;&#xff0c;\u8fd9\u6761\u8fde\u63a5\u5c31\u8fdb\u5165\u4e86\u201c\u7a7a\u95f2\u72b6\u6001\u201d\u3002\u6b64\u65f6&#xff0c;\u4ee5\u4e0b\u51e0\u79cd\u673a\u5236\u53ef\u80fd\u89e6\u53d1\u65ad\u8fde&#xff1a;<\/p>\n<ul>\n<li>\u9632\u706b\u5899\/NAT\u7f51\u5173&#xff1a;\u4f01\u4e1a\u7ea7\u8def\u7531\u5668\u901a\u5e38\u9ed8\u8ba415\u5206\u949f\u6e05\u7406\u4e00\u6b21\u65e0\u6d41\u91cf\u7684\u8fde\u63a5&#xff1b;<\/li>\n<li>\u4e91\u5e73\u53f0\u8d1f\u8f7d\u5747\u8861\u5668&#xff1a;AWS\u3001\u963f\u91cc\u4e91\u7b49\u516c\u6709\u4e91\u7684SLB\u5e38\u8bbe5~10\u5206\u949f\u7a7a\u95f2\u8d85\u65f6&#xff1b;<\/li>\n<li>\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u53c2\u6570&#xff1a;Linux\u9ed8\u8ba4\u7684TCP keepalive\u65f6\u95f4\u4e3a7200\u79d2&#xff08;2\u5c0f\u65f6&#xff09;&#xff0c;\u770b\u4f3c\u5f88\u957f&#xff0c;\u4f46\u524d\u9762\u4e24\u8005\u7684\u4f18\u5148\u7ea7\u66f4\u9ad8\u3002<\/li>\n<\/ul>\n<p>\u5173\u952e\u70b9\u5728\u4e8e&#xff1a;\u8fde\u63a5\u65ad\u5f00 \u2260 \u8fdb\u7a0b\u7ec8\u6b62\u3002\u4f60\u7684PyTorch\u811a\u672c\u5f88\u53ef\u80fd\u4ecd\u5728\u8fd0\u884c&#xff0c;\u53ea\u662f\u4f60\u65e0\u6cd5\u518d\u4e0e\u5b83\u4ea4\u4e92\u4e86\u3002<\/p>\n<p>\u8fd9\u5c31\u5f15\u51fa\u4e86\u4e00\u4e2a\u57fa\u672c\u5224\u65ad\u6807\u51c6&#xff1a;\u5982\u679c\u4f60\u80fd\u901a\u8fc7\u5176\u4ed6\u65b9\u5f0f&#xff08;\u5982\u767b\u5f55\u53e6\u4e00\u7ec8\u7aef\u6267\u884c ps aux | grep python&#xff09;\u770b\u5230\u8bad\u7ec3\u8fdb\u7a0b\u8fd8\u5728&#xff0c;\u90a3\u95ee\u9898\u5c31\u51fa\u5728\u7f51\u7edc\u8fde\u63a5\u7ef4\u62a4\u4e0a&#xff0c;\u800c\u4e0d\u662f\u5e94\u7528\u672c\u8eab\u3002<\/p>\n<hr \/>\n<h4>\u5982\u4f55\u8ba9SSH\u201c\u4e0d\u6b7b\u201d&#xff1f;KeepAlive\u624d\u662f\u6b63\u89e3<\/h4>\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6700\u5e72\u51c0\u7684\u65b9\u5f0f\u4e0d\u662f\u6362\u5de5\u5177\u94fe&#xff0c;\u800c\u662f\u542f\u7528SSH\u81ea\u5e26\u7684KeepAlive\u673a\u5236\u3002\u5b83\u4e0d\u50cf screen \u6216 tmux \u90a3\u6837\u9700\u8981\u989d\u5916\u5b66\u4e60\u6210\u672c&#xff0c;\u4e5f\u4e0d\u6539\u53d8\u4f60\u7684\u5de5\u4f5c\u4e60\u60ef\u2014\u2014\u4f60\u4f9d\u7136\u53ef\u4ee5\u76f4\u63a5 ssh user&#064;host \u7136\u540e\u8fd0\u884cPython\u811a\u672c\u3002<\/p>\n<p>\u5b83\u7684\u539f\u7406\u5f88\u7b80\u5355&#xff1a;\u5b9a\u671f\u53d1\u9001\u63a2\u6d4b\u5305&#xff0c;\u544a\u8bc9\u7f51\u7edc\u8bbe\u5907\u201c\u6211\u8fd8\u6d3b\u7740\u201d&#xff0c;\u4ece\u800c\u963b\u6b62\u8fde\u63a5\u88ab\u56de\u6536\u3002<\/p>\n<h5>\u670d\u52a1\u7aef\u914d\u7f6e&#xff1a;\u8ba9sshd\u4e3b\u52a8\u53d1\u5fc3\u8df3<\/h5>\n<p>\u4fee\u6539 \/etc\/ssh\/sshd_config \u6587\u4ef6&#xff0c;\u52a0\u5165\u4ee5\u4e0b\u4e09\u884c&#xff1a;<\/p>\n<p>ClientAliveInterval 60<br \/>\nClientAliveCountMax 3<br \/>\nTCPKeepAlive yes<\/p>\n<ul>\n<li>ClientAliveInterval 60&#xff1a;\u5982\u679c\u5ba2\u6237\u7aef60\u79d2\u5185\u6ca1\u6709\u4efb\u4f55\u54cd\u5e94&#xff0c;sshd\u5c06\u53d1\u9001\u4e00\u4e2a\u63a2\u6d4b\u8bf7\u6c42&#xff1b;<\/li>\n<li>ClientAliveCountMax 3&#xff1a;\u8fde\u7eed3\u6b21\u63a2\u6d4b\u5931\u8d25\u540e\u624d\u65ad\u5f00\u8fde\u63a5&#xff0c;\u5bb9\u5fcd\u77ed\u6682\u7f51\u7edc\u6296\u52a8&#xff1b;<\/li>\n<li>TCPKeepAlive yes&#xff1a;\u5f00\u542f\u5e95\u5c42TCP\u534f\u8bae\u7684\u4fdd\u6d3b\u673a\u5236&#xff0c;\u9002\u7528\u4e8e\u975e\u4ea4\u4e92\u5f0f\u957f\u8fde\u63a5\u3002<\/li>\n<\/ul>\n<p>\u26a0\ufe0f \u4fee\u6539\u540e\u5fc5\u987b\u91cd\u542f\u670d\u52a1&#xff1a;<\/p>\n<p>bash<br \/>\nsudo systemctl restart sshd<\/p>\n<p>\u6ce8\u610f&#xff1a;\u4e0d\u8981\u628a ClientAliveInterval \u8bbe\u5f97\u592a\u5c0f&#xff08;\u4f8b\u598210\u79d2&#xff09;\u3002\u867d\u7136\u4fdd\u6d3b\u66f4\u53ca\u65f6&#xff0c;\u4f46\u4f1a\u4ea7\u751f\u5927\u91cf\u65e0\u610f\u4e49\u7684\u5c0f\u5305&#xff0c;\u5728\u9ad8\u5e76\u53d1\u73af\u5883\u4e0b\u53ef\u80fd\u5f71\u54cd\u6027\u80fd\u300260\u79d2\u662f\u4e00\u4e2a\u7ecf\u8fc7\u9a8c\u8bc1\u7684\u5e73\u8861\u70b9\u2014\u2014\u65e2\u80fd\u6709\u6548\u9632\u6b62\u4e3b\u6d41\u9632\u706b\u5899\u768415\u5206\u949f\u56de\u6536\u7b56\u7565&#xff0c;\u53c8\u4e0d\u4f1a\u9020\u6210\u663e\u8457\u7f51\u7edc\u8d1f\u62c5\u3002<\/p>\n<h5>\u5ba2\u6237\u7aef\u914d\u7f6e&#xff1a;\u4ece\u672c\u5730\u53d1\u8d77\u4fdd\u6d3b<\/h5>\n<p>\u6709\u65f6\u5019&#xff0c;\u4f60\u65e0\u6cd5\u63a7\u5236\u8fdc\u7a0b\u670d\u52a1\u5668\u7684\u914d\u7f6e&#xff08;\u6bd4\u5982\u5171\u4eab\u96c6\u7fa4\u4e0d\u5141\u8bb8\u6539sshd_config&#xff09;&#xff0c;\u8fd9\u65f6\u53ef\u4ee5\u5728\u672c\u5730 .ssh\/config \u4e2d\u8bbe\u7f6e\u53cd\u5411\u4fdd\u6d3b&#xff1a;<\/p>\n<p>Host ai-server<br \/>\n    HostName 192.168.1.100<br \/>\n    Port 2222<br \/>\n    User developer<br \/>\n    ServerAliveInterval 60<br \/>\n    ServerAliveCountMax 3<br \/>\n    TCPKeepAlive yes<\/p>\n<ul>\n<li>ServerAliveInterval \u662f\u7531\u5ba2\u6237\u7aef\u4e3b\u52a8\u5411\u670d\u52a1\u5668\u53d1\u9001\u201c\u6211\u8fd8\u5728\u8fd9\u201d\u7684\u4fe1\u53f7&#xff1b;<\/li>\n<li>\u7279\u522b\u9002\u5408\u7ed5\u8fc7\u53ea\u76d1\u63a7\u51fa\u7ad9\u6d41\u91cf\u7684\u516c\u53f8\u9632\u706b\u5899&#xff1b;<\/li>\n<li>\u63a8\u8350\u548c\u670d\u52a1\u5668\u7aef\u914d\u7f6e\u914d\u5408\u4f7f\u7528&#xff0c;\u5f62\u6210\u53cc\u91cd\u4fdd\u969c\u3002<\/li>\n<\/ul>\n<p>\u8fd9\u4e2a\u914d\u7f6e\u7684\u597d\u5904\u662f\u5b8c\u5168\u900f\u660e\u3002\u53ea\u8981\u4f60\u7528 ssh ai-server \u767b\u5f55&#xff0c;\u5c31\u4f1a\u81ea\u52a8\u5e26\u4e0a\u4fdd\u6d3b\u903b\u8f91&#xff0c;\u65e0\u9700\u6bcf\u6b21\u624b\u52a8\u52a0\u53c2\u6570\u3002<\/p>\n<hr \/>\n<h4>\u5728PyTorch-CUDA-v2.6\u955c\u50cf\u4e2d\u56fa\u5316\u8fd9\u4e00\u5b9e\u8df5<\/h4>\n<p>\u73b0\u5728\u6211\u4eec\u56de\u5230\u5b9e\u9645\u5de5\u7a0b\u573a\u666f\u3002\u5047\u8bbe\u4f60\u4f7f\u7528\u7684\u662f\u4e00\u5957\u6807\u51c6\u5316\u7684 pytorch-cuda:v2.6 \u955c\u50cf&#xff0c;\u57fa\u4e8eUbuntu 20.04 &#043; CUDA 11.8 &#043; PyTorch 2.6 \u6784\u5efa\u3002\u8fd9\u79cd\u955c\u50cf\u901a\u5e38\u7528\u4e8e\u5feb\u901f\u90e8\u7f72GPU\u8bad\u7ec3\u73af\u5883\u3002<\/p>\n<p>\u4f46\u9ed8\u8ba4\u60c5\u51b5\u4e0b&#xff0c;\u8fd9\u7c7b\u955c\u50cf\u5f80\u5f80\u5ffd\u7565\u4e86SSH\u4fdd\u6d3b\u914d\u7f6e&#xff0c;\u5bfc\u81f4\u6bcf\u4e2a\u65b0\u7528\u6237\u90fd\u5f97\u91cd\u590d\u6392\u67e5\u8fde\u63a5\u4e2d\u65ad\u95ee\u9898\u3002<\/p>\n<p>\u806a\u660e\u7684\u505a\u6cd5\u662f&#xff1a;\u5728Dockerfile\u4e2d\u76f4\u63a5\u6ce8\u5165KeepAlive\u914d\u7f6e&#xff0c;\u8ba9\u5b83\u6210\u4e3a\u955c\u50cf\u7684\u6807\u51c6\u884c\u4e3a\u3002<\/p>\n<p># \u8bbe\u7f6eSSH\u4fdd\u6d3b\u53c2\u6570<br \/>\nRUN echo &#034;ClientAliveInterval 60&#034; &gt;&gt; \/etc\/ssh\/sshd_config &amp;&amp; \\\\<br \/>\n    echo &#034;ClientAliveCountMax 3&#034; &gt;&gt; \/etc\/ssh\/sshd_config &amp;&amp; \\\\<br \/>\n    echo &#034;TCPKeepAlive yes&#034; &gt;&gt; \/etc\/ssh\/sshd_config<\/p>\n<p># \u786e\u4fddsshd\u670d\u52a1\u542f\u52a8&#xff08;\u67d0\u4e9b\u57fa\u7840\u955c\u50cf\u53ef\u80fd\u672a\u542f\u7528&#xff09;<br \/>\nCOPY sshd.service \/etc\/systemd\/system\/sshd.service<br \/>\nRUN systemctl enable sshd<\/p>\n<p>\u8fd9\u6837&#xff0c;\u65e0\u8bba\u8c01\u62c9\u53d6\u8fd9\u4e2a\u955c\u50cf\u5e76\u542f\u52a8\u5bb9\u5668&#xff0c;SSH\u8fde\u63a5\u90fd\u4f1a\u9ed8\u8ba4\u5177\u5907\u6297\u4e2d\u65ad\u80fd\u529b\u3002\u4e0d\u9700\u8981\u989d\u5916\u6587\u6863\u63d0\u9192&#xff0c;\u4e5f\u4e0d\u4f1a\u56e0\u4e3a\u201c\u5fd8\u4e86\u914d\u201d\u800c\u5bfc\u81f4\u7ebf\u4e0a\u95ee\u9898\u3002<\/p>\n<p>\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u8fd9\u79cd\u505a\u6cd5\u7b26\u5408 DevOps \u7684\u6838\u5fc3\u7406\u5ff5&#xff1a;\u628a\u8fd0\u7ef4\u7ecf\u9a8c\u7f16\u7801\u8fdb\u57fa\u7840\u8bbe\u65bd&#xff0c;\u800c\u4e0d\u662f\u4f9d\u8d56\u4e2a\u4eba\u8bb0\u5fc6\u6216\u64cd\u4f5c\u624b\u518c\u3002<\/p>\n<hr \/>\n<h4>\u5b9e\u6218\u9a8c\u8bc1&#xff1a;\u770b\u770bGPU\u5230\u5e95\u80fd\u4e0d\u80fd\u6b63\u5e38\u5de5\u4f5c<\/h4>\n<p>\u914d\u7f6e\u5b8cSSH\u540e&#xff0c;\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u786e\u8ba4\u6574\u4e2a\u6df1\u5ea6\u5b66\u4e60\u73af\u5883\u662f\u5426\u53ef\u7528\u3002\u53ef\u4ee5\u5199\u4e00\u6bb5\u7b80\u5355\u7684Python\u811a\u672c\u6765\u6d4b\u8bd5&#xff1a;<\/p>\n<p>import torch<\/p>\n<p>print(f&#034;PyTorch Version: {torch.__version__}&#034;)<\/p>\n<p>if torch.cuda.is_available():<br \/>\n    print(&#034;\u2705 CUDA is available&#034;)<br \/>\n    print(f&#034;GPU Count: {torch.cuda.device_count()}&#034;)<br \/>\n    print(f&#034;Current GPU: {torch.cuda.get_device_name(0)}&#034;)<br \/>\nelse:<br \/>\n    print(&#034;\u274c CUDA not available&#034;)<\/p>\n<p># \u6267\u884c\u4e00\u6b21GPU\u5f20\u91cf\u8fd0\u7b97<br \/>\nx &#061; torch.randn(3, 3).cuda()<br \/>\ny &#061; torch.randn(3, 3).cuda()<br \/>\nz &#061; torch.matmul(x, y)<br \/>\nprint(&#034;GPU Tensor Operation Success:&#034;, z.cpu())<\/p>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u4e0d\u4ec5\u80fd\u68c0\u67e5CUDA\u662f\u5426\u52a0\u8f7d\u6210\u529f&#xff0c;\u8fd8\u80fd\u9a8c\u8bc1NVIDIA\u9a71\u52a8\u3001cuBLAS\u5e93\u4ee5\u53ca\u663e\u5b58\u5206\u914d\u662f\u5426\u6b63\u5e38\u3002\u5c24\u5176\u662f\u5728\u591a\u5361\u73af\u5883\u4e2d&#xff0c;torch.cuda.device_count() \u662f\u5426\u8fd4\u56de\u9884\u671f\u503c\u975e\u5e38\u5173\u952e\u3002<\/p>\n<p>\u5efa\u8bae\u628a\u8fd9\u4e2a\u811a\u672c\u653e\u5728\u5bb9\u5668\u7684 \/workspace\/diagnose.py \u4e0b&#xff0c;\u4f5c\u4e3a\u6bcf\u6b21\u65b0\u73af\u5883\u4e0a\u7ebf\u524d\u7684\u6807\u51c6\u68c0\u6d4b\u9879\u3002<\/p>\n<hr \/>\n<h4>\u5178\u578b\u67b6\u6784\u4e2d\u7684\u4f4d\u7f6e\u4e0e\u534f\u4f5c\u65b9\u5f0f<\/h4>\n<p>\u5728\u4e00\u4e2a\u5178\u578b\u7684AI\u5f00\u53d1\u6d41\u7a0b\u4e2d&#xff0c;\u6574\u4f53\u7ed3\u6784\u901a\u5e38\u662f\u8fd9\u6837\u7684&#xff1a;<\/p>\n<p>[\u672c\u5730\u7b14\u8bb0\u672c]<br \/>\n   \u2502<br \/>\n   \u251c\u2500 SSH \u2192 [\u8fdc\u7a0b\u670d\u52a1\u5668] \u2192 Docker\u5bb9\u5668&#xff08;pytorch-cuda:v2.6&#xff09;<br \/>\n   \u2502                             \u251c\u2500\u2500 GPU\u8d44\u6e90&#xff08;A100 \u00d7 4&#xff09;<br \/>\n   \u2502                             \u251c\u2500\u2500 \u6570\u636e\u5377\u6620\u5c04&#xff08;\/data&#xff09;<br \/>\n   \u2502                             \u2514\u2500\u2500 \u7aef\u53e3\u66b4\u9732&#xff08;2222&#xff09;<br \/>\n   \u2502<br \/>\n   \u2514\u2500 \u53ef\u9009&#xff1a;Jupyter Notebook \u2190 (\u540c\u4e00\u5bb9\u5668&#xff0c;\u7aef\u53e38888)<\/p>\n<p>\u7528\u6237\u4e3b\u8981\u901a\u8fc7SSH\u8fdb\u5165\u5bb9\u5668\u5185\u90e8\u8fdb\u884c\u547d\u4ee4\u884c\u64cd\u4f5c&#xff0c;\u800cJupyter\u5219\u7528\u4e8e\u5feb\u901f\u539f\u578b\u8bbe\u8ba1\u3002\u4e24\u8005\u5171\u4eab\u540c\u4e00\u4e2a\u73af\u5883&#xff0c;\u4f46SSH\u66f4\u9002\u5408\u957f\u671f\u4efb\u52a1\u7ba1\u7406\u3002<\/p>\n<p>\u542f\u52a8\u547d\u4ee4\u793a\u4f8b&#xff1a;<\/p>\n<p>docker run -d \\\\<br \/>\n  &#8211;gpus all \\\\<br \/>\n  -p 2222:22 \\\\<br \/>\n  -p 8888:8888 \\\\<br \/>\n  -v \/path\/to\/data:\/workspace\/data \\\\<br \/>\n  -v \/path\/to\/code:\/workspace\/code \\\\<br \/>\n  &#8211;name pytorch-train pytorch-cuda:v2.6<\/p>\n<p>\u4e00\u65e6\u5bb9\u5668\u8fd0\u884c\u8d77\u6765&#xff0c;\u5c31\u53ef\u4ee5\u901a\u8fc7&#xff1a;<\/p>\n<p>ssh -p 2222 developer&#064;server_ip<\/p>\n<p>\u76f4\u63a5\u767b\u5f55&#xff0c;\u5e76\u5f00\u59cb\u6267\u884c\u8bad\u7ec3\u4efb\u52a1&#xff1a;<\/p>\n<p>python train.py &#8211;epochs 100 &#8211;batch-size 64<\/p>\n<p>\u53ea\u8981KeepAlive\u5df2\u542f\u7528&#xff0c;\u5373\u4f7f\u4f60\u79bb\u5f00\u7535\u8111\u4e00\u5c0f\u65f6&#xff0c;\u8fde\u63a5\u4f9d\u7136\u5065\u5728&#xff0c;\u65e5\u5fd7\u6301\u7eed\u6eda\u52a8&#xff0c;\u968f\u65f6\u53ef\u5e72\u9884\u3002<\/p>\n<hr \/>\n<h4>\u56e2\u961f\u534f\u4f5c\u4e2d\u7684\u6700\u4f73\u5b9e\u8df5<\/h4>\n<p>\u5149\u81ea\u5df1\u4f1a\u914d\u8fd8\u4e0d\u591f&#xff0c;\u771f\u6b63\u7684\u4ef7\u503c\u5728\u4e8e\u6807\u51c6\u5316\u3002\u4ee5\u4e0b\u662f\u6211\u4eec\u5728\u591a\u4e2aAI\u9879\u76ee\u4e2d\u603b\u7ed3\u51fa\u7684\u6709\u6548\u505a\u6cd5&#xff1a;<\/p>\n<h5>1. \u628aSSH\u4fdd\u6d3b\u7eb3\u5165CI\/CD\u6d41\u6c34\u7ebf<\/h5>\n<p>\u5728\u6784\u5efa\u955c\u50cf\u7684GitHub Actions\u6216Jenkins\u6d41\u7a0b\u4e2d&#xff0c;\u52a0\u5165\u4e00\u6761\u68c0\u67e5\u89c4\u5219&#xff1a;<\/p>\n<p>&#8211; name: Verify SSH KeepAlive is enabled<br \/>\n  run: |<br \/>\n    docker exec $CONTAINER_NAME sh -c &#034;grep -q &#039;ClientAliveInterval 60&#039; \/etc\/ssh\/sshd_config&#034;<\/p>\n<p>\u786e\u4fdd\u6bcf\u4e00\u6b21\u53d1\u5e03\u7684\u955c\u50cf\u90fd\u5305\u542b\u8be5\u9879\u914d\u7f6e&#xff0c;\u907f\u514d\u4eba\u4e3a\u9057\u6f0f\u3002<\/p>\n<h5>2. \u4f7f\u7528\u5bc6\u94a5\u8ba4\u8bc1 &#043; \u666e\u901a\u7528\u6237\u767b\u5f55<\/h5>\n<p>\u7981\u6b62root\u76f4\u63a5SSH\u767b\u5f55&#xff0c;\u521b\u5efa\u4e13\u7528\u5f00\u53d1\u8d26\u6237&#xff1a;<\/p>\n<p>adduser developer<br \/>\nusermod -aG sudo developer<\/p>\n<p>\u5e76\u5f3a\u5236\u4f7f\u7528SSH\u5bc6\u94a5\u767b\u5f55&#xff1a;<\/p>\n<p>PubkeyAuthentication yes<br \/>\nPasswordAuthentication no<\/p>\n<p>\u65e2\u5b89\u5168\u53c8\u65b9\u4fbf\u81ea\u52a8\u5316\u8fde\u63a5\u3002<\/p>\n<h5>3. \u7ed3\u5408\u65e5\u5fd7\u91c7\u96c6\u7cfb\u7edf\u505a\u53cc\u91cd\u76d1\u63a7<\/h5>\n<p>\u5c3d\u7ba1KeepAlive\u5927\u5927\u964d\u4f4e\u4e86\u65ad\u8fde\u6982\u7387&#xff0c;\u4f46\u4ecd\u5efa\u8bae\u5bf9\u5173\u952e\u4efb\u52a1\u542f\u7528\u65e5\u5fd7\u6301\u4e45\u5316&#xff1a;<\/p>\n<p>nohup python train.py &gt; logs\/train_$(date &#043;%F).log 2&gt;&amp;1 &amp;<\/p>\n<p>\u6216\u5c06\u65e5\u5fd7\u63a5\u5165ELK\u6216Prometheus&#xff0c;\u5b9e\u73b0\u53ef\u89c6\u5316\u8ffd\u8e2a\u3002\u8fd9\u6837\u5373\u4f7f\u7ec8\u7aef\u65ad\u5f00&#xff0c;\u4e5f\u80fd\u901a\u8fc7Web\u754c\u9762\u67e5\u770b\u8bad\u7ec3\u72b6\u6001\u3002<\/p>\n<h5>4. \u63d0\u4f9b\u6a21\u677f\u5316\u7684 .ssh\/config<\/h5>\n<p>\u7ed9\u56e2\u961f\u6210\u5458\u5206\u53d1\u4e00\u4efd\u6807\u51c6\u914d\u7f6e\u6a21\u677f&#xff1a;<\/p>\n<p>Host gpu-node-*<br \/>\n    User developer<br \/>\n    IdentityFile ~\/.ssh\/id_ed25519_gpu<br \/>\n    ServerAliveInterval 60<br \/>\n    ServerAliveCountMax 3<br \/>\n    TCPKeepAlive yes<br \/>\n    Compression yes<\/p>\n<p>\u914d\u5408\u4e3b\u673a\u547d\u540d\u89c4\u8303&#xff08;\u5982 gpu-node-01, gpu-node-02&#xff09;&#xff0c;\u5b9e\u73b0\u4e00\u952e\u514d\u5bc6&#043;\u4fdd\u6d3b\u8fde\u63a5\u3002<\/p>\n<hr \/>\n<h4>\u6548\u679c\u5bf9\u6bd4&#xff1a;\u4ece\u201c\u63d0\u5fc3\u540a\u80c6\u201d\u5230\u201c\u5b89\u5fc3\u5165\u7761\u201d<\/h4>\n<p>\u6211\u4eec\u66fe\u5728\u4e00\u4e2a\u81ea\u7136\u8bed\u8a00\u5904\u7406\u56e2\u961f\u4e2d\u5b9e\u65bd\u8fd9\u9879\u4f18\u5316\u3002\u6b64\u524d\u4ed6\u4eec\u5fae\u8c03\u5927\u6a21\u578b\u65f6&#xff0c;\u5e73\u5747\u6bcf\u5929\u8981\u91cd\u8fde3~5\u6b21&#xff0c;\u7ecf\u5e38\u9519\u8fc7\u5173\u952e\u7684\u6536\u655b\u62d0\u70b9\u3002<\/p>\n<p>\u5f15\u5165\u7edf\u4e00\u955c\u50cf&#043;KeepAlive\u914d\u7f6e\u540e&#xff0c;\u6548\u679c\u7acb\u7aff\u89c1\u5f71&#xff1a;<\/p>\n<table>\n<tr>\u6307\u6807\u6539\u8fdb\u524d\u6539\u8fdb\u540e<\/tr>\n<tbody>\n<tr>\n<td>\u5e73\u5747\u8fde\u63a5\u6301\u7eed\u65f6\u95f4<\/td>\n<td>~75\u5206\u949f<\/td>\n<td>&gt;24\u5c0f\u65f6<\/td>\n<\/tr>\n<tr>\n<td>\u65e5\u5747\u91cd\u8fde\u6b21\u6570<\/td>\n<td>3~5\u6b21<\/td>\n<td>0~1\u6b21<\/td>\n<\/tr>\n<tr>\n<td>\u8bad\u7ec3\u53ef\u89c2\u6d4b\u6027<\/td>\n<td>\u5dee<\/td>\n<td>\u5b9e\u65f6\u53ef\u89c6<\/td>\n<\/tr>\n<tr>\n<td>\u5f00\u53d1\u8005\u6ee1\u610f\u5ea6<\/td>\n<td>\u4e00\u822c<\/td>\n<td>\u663e\u8457\u63d0\u5347<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6700\u76f4\u89c2\u7684\u611f\u53d7\u662f&#xff1a;\u5927\u5bb6\u7ec8\u4e8e\u6562\u5728\u665a\u4e0a\u63d0\u4ea4\u8bad\u7ec3\u4efb\u52a1\u540e\u56de\u5bb6\u7761\u89c9\u4e86\u2014\u2014\u56e0\u4e3a\u77e5\u9053\u7b2c\u4e8c\u5929\u65e9\u4e0a\u6253\u5f00\u7ec8\u7aef&#xff0c;\u8fde\u63a5\u8fd8\u5728&#xff0c;\u65e5\u5fd7\u5b8c\u6574\u3002<\/p>\n<hr \/>\n<h4>\u5c0f\u6539\u52a8&#xff0c;\u5927\u610f\u4e49<\/h4>\n<p>\u4e5f\u8bb8\u4f60\u4f1a\u89c9\u5f97&#xff0c;\u8fd9\u53ea\u662f\u51e0\u884c\u914d\u7f6e\u800c\u5df2&#xff0c;\u4f55\u5fc5\u5927\u8d39\u5468\u7ae0&#xff1f;<\/p>\n<p>\u4f46\u6b63\u662f\u8fd9\u4e9b\u770b\u4f3c\u5fae\u4e0d\u8db3\u9053\u7684\u7ec6\u8282&#xff0c;\u51b3\u5b9a\u4e86\u5de5\u7a0b\u5e08\u80fd\u5426\u4e13\u6ce8\u4e8e\u771f\u6b63\u91cd\u8981\u7684\u4e8b\u2014\u2014\u6a21\u578b\u7ed3\u6784\u8bbe\u8ba1\u3001\u8d85\u53c2\u8c03\u4f18\u3001\u4e1a\u52a1\u7406\u89e3\u3002<\/p>\n<p>\u5f53\u6211\u4eec\u628a\u73af\u5883\u7a33\u5b9a\u6027\u3001\u8fde\u63a5\u53ef\u9760\u6027\u8fd9\u4e9b\u201c\u566a\u97f3\u201d\u964d\u5230\u6700\u4f4e&#xff0c;\u521b\u9020\u529b\u624d\u6709\u7a7a\u95f4\u6d6e\u73b0\u3002<\/p>\n<p>\u6240\u4ee5&#xff0c;\u4e0b\u6b21\u5f53\u4f60\u6784\u5efa\u4e00\u4e2a\u65b0\u7684PyTorch\u955c\u50cf\u65f6&#xff0c;\u8bf7\u8bb0\u5f97\u52a0\u4e0a\u8fd9\u4e09\u884c&#xff1a;<\/p>\n<p>ClientAliveInterval 60<br \/>\nClientAliveCountMax 3<br \/>\nTCPKeepAlive yes<\/p>\n<p>\u5b83\u4e0d\u4f1a\u589e\u52a0\u4efb\u4f55\u8fd0\u884c\u5f00\u9500&#xff0c;\u5374\u80fd\u8ba9\u6bcf\u4e00\u4e2a\u4f7f\u7528\u5b83\u7684\u4eba\u5c11\u4e00\u6b21\u7126\u8651\u3001\u591a\u4e00\u5206\u4e13\u6ce8\u3002<\/p>\n<p>\u800c\u8fd9&#xff0c;\u624d\u662f\u4f18\u79c0\u6280\u672f\u57fa\u7840\u8bbe\u65bd\u8be5\u6709\u7684\u6837\u5b50\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e&#xff1f;PyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e<br \/>\n\u5728\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u7684\u65e5\u5e38\u5f00\u53d1\u4e2d&#xff0c;\u4f60\u662f\u5426\u7ecf\u5386\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u6a21\u578b\u6b63\u5728\u8bad\u7ec3BERT\u6216ResNet&#xff0c;\u7ec8\u7aef\u91cc\u65e5\u5fd7\u6b63\u7a33\u5b9a\u8f93\u51fa&#xff0c;\u4f60\u53bb\u6ce1\u4e86\u676f\u5496\u5561\u56de\u6765\u2014\u2014\u7ed3\u679c\u53d1\u73b0SSH\u8fde\u63a5\u5df2\u7ecf\u65ad\u5f00&#xff0c;\u7ec8\u7aef\u663e\u793a Write failed: Broken pipe\u3002\u867d\u7136\u8bad\u7ec3\u8fdb\u7a0b\u5176\u5b9e\u8fd8\u5728\u540e\u53f0\u8dd1\u7740&#xff08;\u7528 ps \u80fd\u67e5\u5230&#xff09;&#xff0c;\u4f46\u4f60\u518d\u4e5f\u770b\u4e0d\u5230\u5b9e<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[9912,9911,152],"topic":[],"class_list":["post-87510","post","type-post","status-publish","format-standard","hentry","category-server","tag-keepalive","tag-ssh","tag-pytorch"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/87510.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e&#xff1f;PyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e \u5728\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u7684\u65e5\u5e38\u5f00\u53d1\u4e2d&#xff0c;\u4f60\u662f\u5426\u7ecf\u5386\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u6a21\u578b\u6b63\u5728\u8bad\u7ec3BERT\u6216ResNet&#xff0c;\u7ec8\u7aef\u91cc\u65e5\u5fd7\u6b63\u7a33\u5b9a\u8f93\u51fa&#xff0c;\u4f60\u53bb\u6ce1\u4e86\u676f\u5496\u5561\u56de\u6765\u2014\u2014\u7ed3\u679c\u53d1\u73b0SSH\u8fde\u63a5\u5df2\u7ecf\u65ad\u5f00&#xff0c;\u7ec8\u7aef\u663e\u793a Write failed: Broken pipe\u3002\u867d\u7136\u8bad\u7ec3\u8fdb\u7a0b\u5176\u5b9e\u8fd8\u5728\u540e\u53f0\u8dd1\u7740&#xff08;\u7528 ps \u80fd\u67e5\u5230&#xff09;&#xff0c;\u4f46\u4f60\u518d\u4e5f\u770b\u4e0d\u5230\u5b9e\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/87510.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-30T06:16:40+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87510.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/87510.html\",\"name\":\"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-30T06:16:40+00:00\",\"dateModified\":\"2026-07-30T06:16:40+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/87510.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/87510.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/87510.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/87510.html","og_locale":"zh_CN","og_type":"article","og_title":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e&#xff1f;PyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e \u5728\u6df1\u5ea6\u5b66\u4e60\u9879\u76ee\u7684\u65e5\u5e38\u5f00\u53d1\u4e2d&#xff0c;\u4f60\u662f\u5426\u7ecf\u5386\u8fc7\u8fd9\u6837\u7684\u573a\u666f&#xff1a;\u6a21\u578b\u6b63\u5728\u8bad\u7ec3BERT\u6216ResNet&#xff0c;\u7ec8\u7aef\u91cc\u65e5\u5fd7\u6b63\u7a33\u5b9a\u8f93\u51fa&#xff0c;\u4f60\u53bb\u6ce1\u4e86\u676f\u5496\u5561\u56de\u6765\u2014\u2014\u7ed3\u679c\u53d1\u73b0SSH\u8fde\u63a5\u5df2\u7ecf\u65ad\u5f00&#xff0c;\u7ec8\u7aef\u663e\u793a Write failed: Broken pipe\u3002\u867d\u7136\u8bad\u7ec3\u8fdb\u7a0b\u5176\u5b9e\u8fd8\u5728\u540e\u53f0\u8dd1\u7740&#xff08;\u7528 ps \u80fd\u67e5\u5230&#xff09;&#xff0c;\u4f46\u4f60\u518d\u4e5f\u770b\u4e0d\u5230\u5b9e","og_url":"https:\/\/www.wsisp.com\/helps\/87510.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-30T06:16:40+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/87510.html","url":"https:\/\/www.wsisp.com\/helps\/87510.html","name":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-30T06:16:40+00:00","dateModified":"2026-07-30T06:16:40+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/87510.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/87510.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/87510.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"SSH\u8fde\u63a5\u8d85\u65f6\u600e\u4e48\u529e\uff1fPyTorch\u670d\u52a1\u5668KeepAlive\u8bbe\u7f6e"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87510","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=87510"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/87510\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=87510"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=87510"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=87510"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=87510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}