{"id":15339,"date":"2025-04-18T21:53:14","date_gmt":"2025-04-18T13:53:14","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/15339.html"},"modified":"2025-04-18T21:53:14","modified_gmt":"2025-04-18T13:53:14","slug":"%e3%80%90%e4%ba%91%e5%8e%9f%e7%94%9f%e6%8a%80%e6%9c%af%e3%80%91ssh-usrip-cat-aa-text%e6%98%af%e8%bf%9b%e5%85%a5%e5%88%b0%e7%9b%ae%e6%a0%87%e6%9c%8d%e5%8a%a1%e5%99%a8%e8%bf%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/15339.html","title":{"rendered":"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f"},"content":{"rendered":"<\/p>\n<h4>ssh usr&#064;ip \u2019cat aa.text\u2018&gt;&gt;aa.log\u7528\u6cd5\u9047\u5230\u95ee\u9898\u96c6\u9526<\/h4>\n<ul>\n<li>\u4e00\u3001ssh usr&#064;ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c&#xff1f;<\/li>\n<li>\u4e8c\u3001ssh usr&#064;ip \u2019cat aa.text\u2018 &gt;&gt;aa.log \u662f\u628a\u65e5\u5fd7\u751f\u6210\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u91cc&#xff1f;<\/li>\n<li>\u4e09\u3001ssh usr&#064;ip &lt;&lt;&#039;EOF&#039; cat aa.text&gt;&gt; aa.log EOF\u662f\u628a\u65e5\u5fd7\u751f\u6210\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u91cc&#xff1f;<\/li>\n<li>\u56db\u3001&lt;&lt;&#039;EOF&#039; EOF \u662f\u5e72\u561b\u7684&#xff1f;<\/li>\n<li>\n<ul>\n<li>\n<ul>\n<li>\u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/li>\n<li>\u5177\u4f53\u6d41\u7a0b<\/li>\n<li>\u793a\u4f8b<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u4e94\u3001&lt;&lt;&#039;EOF&#039; EOF \u4e3a\u4ec0\u4e48\u5e26\u4e0a\u5b83\u5c31\u662f\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7684&#xff0c;\u4e0d\u5e26\u5c31\u662f\u5728\u81ea\u5df1\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7684&#xff1f;<\/li>\n<li>\n<ul>\n<li>1. \u5c06\u547d\u4ee4&#xff08;\u542b\u91cd\u5b9a\u5411&#xff09;\u5305\u5728 heredoc \u91cc\u4f20\u7ed9 &#096;ssh&#096;<\/li>\n<li>2. \u5728\u672c\u5730 Shell \u4e2d\u5199\u91cd\u5b9a\u5411<\/li>\n<li>\n<ul>\n<li>\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8fd9\u79cd\u73b0\u8c61&#xff1f;<\/li>\n<\/ul>\n<\/li>\n<li>\u5c0f\u7ed3<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u4e00\u3001ssh usr&#064;ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c&#xff1f;<\/h2>\n<p>\u5f53\u60a8\u6267\u884c ssh usr&#064;ip &#039;cat aa.text&#039; \u8fd9\u6761\u547d\u4ee4\u65f6&#xff0c;cat aa.text \u5b9e\u9645\u662f\u5728 \u8fdc\u7a0b\u670d\u52a1\u5668&#xff08;usr&#064;ip&#xff09;\u4e0a\u6267\u884c\u7684&#xff0c;\u4e0d\u662f\u5728\u672c\u673a\u6267\u884c\u3002\u7b80\u5355\u6765\u8bf4&#xff0c;\u60a8\u901a\u8fc7 SSH \u767b\u5f55\u5230\u76ee\u6807\u670d\u52a1\u5668&#xff0c;\u7136\u540e\u5728\u8be5\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u6307\u5b9a\u7684\u547d\u4ee4\u3002<\/p>\n<h2>\u4e8c\u3001ssh usr&#064;ip \u2019cat aa.text\u2018 &gt;&gt;aa.log \u662f\u628a\u65e5\u5fd7\u751f\u6210\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u91cc&#xff1f;<\/h2>\n<p>\u5f53\u6267\u884c<\/p>\n<p>ssh usr&#064;ip &#039;cat aa.text&#039; &gt;&gt; aa.log<\/p>\n<p>\u65f6&#xff0c;cat aa.text \u662f\u5728\u8fdc\u7a0b\u670d\u52a1\u5668&#xff08;usr&#064;ip&#xff09;\u4e0a\u6267\u884c\u7684&#xff0c;\u4f46\u5c06\u5176\u8f93\u51fa\u91cd\u5b9a\u5411\u5199\u5165 aa.log \u7684\u64cd\u4f5c\u662f\u7531\u672c\u5730 Shell \u5b8c\u6210&#xff0c;\u56e0\u6b64 \u65e5\u5fd7\u6587\u4ef6\u751f\u6210\u5e76\u4fdd\u5b58\u5728\u672c\u5730\u673a\u5668\u3002<\/p>\n<p>\u6362\u8a00\u4e4b&#xff1a;<\/p>\n<ul>\n<li>\u8fdc\u7a0b\u670d\u52a1\u5668&#xff1a;\u53ea\u8d1f\u8d23\u6267\u884c cat aa.text \u547d\u4ee4\u5e76\u8f93\u51fa\u7ed3\u679c\u3002<\/li>\n<li>\u672c\u5730&#xff1a;\u5c06 SSH \u4f20\u56de\u7684\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230 aa.log \u6587\u4ef6\u91cc\u3002<\/li>\n<\/ul>\n<h2>\u4e09\u3001ssh usr&#064;ip &lt;&lt;\u2018EOF\u2019 cat aa.text&gt;&gt; aa.log EOF\u662f\u628a\u65e5\u5fd7\u751f\u6210\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u91cc&#xff1f;<\/h2>\n<p>\u5728\u8fd9\u79cd\u5199\u6cd5\u91cc&#xff1a;<\/p>\n<p><span class=\"token function\">ssh<\/span> usr&#064;ip <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\ncat aa.text &gt;&gt; aa.log<br \/>\nEOF<\/span><\/p>\n<p>\u91cd\u5b9a\u5411&#xff08;&gt;&gt; aa.log&#xff09;\u662f\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7684\u3002\u7531\u4e8e\u6574\u6bb5\u547d\u4ee4&#xff08;\u5305\u62ec cat aa.text &gt;&gt; aa.log&#xff09;\u90fd\u5199\u5728 heredoc \u5f53\u4e2d&#xff0c;\u4f1a\u88ab\u8fdc\u7aef\u7684 Shell \u89e3\u91ca\u5e76\u6267\u884c&#xff0c;\u6240\u4ee5\u751f\u6210\u6216\u8ffd\u52a0\u65e5\u5fd7\u7684 aa.log \u6587\u4ef6\u4f1a\u51fa\u73b0\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u3002<\/p>\n<p>\u5982\u679c\u5e0c\u671b\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u672c\u5730&#xff0c;\u9700\u8981\u628a\u91cd\u5b9a\u5411\u7b26\u53f7\u653e\u5728\u672c\u5730 Shell\u3002\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token function\">ssh<\/span> usr&#064;ip <span class=\"token string\">&#034;cat aa.text&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> aa.log<\/p>\n<p>\u6b64\u65f6 cat aa.text \u5728\u8fdc\u7a0b\u6267\u884c&#xff0c;\u4f46\u8f93\u51fa\u6d41\u91cd\u5b9a\u5411\u7531\u672c\u5730 Shell \u5904\u7406&#xff0c;\u751f\u6210\u7684 aa.log \u5219\u4f1a\u5728\u672c\u5730\u4e3b\u673a\u4e0a\u3002<\/p>\n<h2>\u56db\u3001&lt;&lt;\u2018EOF\u2019 EOF \u662f\u5e72\u561b\u7684&#xff1f;<\/h2>\n<p>\u5728 Shell \u811a\u672c\u6216\u547d\u4ee4\u884c\u91cc&#xff0c;<\/p>\n<p><span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\n    &#8230;\u8fd9\u91cc\u662f\u5185\u5bb9&#8230;<br \/>\nEOF<\/span><\/p>\n<p>\u662f\u4e00\u79cd Heredoc&#xff08;Here Document&#xff09;\u7684\u5199\u6cd5\u3002\u5176\u4f5c\u7528\u662f\u5c06 EOF&#xff08;\u6216\u8005\u4f60\u6307\u5b9a\u7684\u7ed3\u675f\u7b26\u53f7&#xff09;\u4e4b\u95f4\u7684\u591a\u884c\u6587\u672c&#xff0c;\u5f53\u4f5c\u6807\u51c6\u8f93\u5165 \u4f20\u7ed9\u524d\u9762\u6240\u63a5\u7684\u547d\u4ee4\u3002<\/p>\n<p>\u901a\u5e38\u6211\u4eec\u89c1\u5230\u7684\u5199\u6cd5\u4f1a\u662f&#xff1a;<\/p>\n<p><span class=\"token builtin class-name\">command<\/span> <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">EOF<br \/>\n    \u8fd9\u91cc\u662f\u8f93\u5165&#8230;<br \/>\nEOF<\/span><\/p>\n<p>\u6216\u8005<\/p>\n<p><span class=\"token builtin class-name\">command<\/span> <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\n    \u8fd9\u91cc\u662f\u8f93\u5165&#8230;<br \/>\nEOF<\/span><\/p>\n<h4>\u6709\u4ec0\u4e48\u533a\u522b&#xff1f;<\/h4>\n<ul>\n<li>\u4e0d\u5e26\u5f15\u53f7\u7684 EOF&#xff1a;\u5728\u8fd9\u79cd\u5199\u6cd5\u4e2d&#xff0c;\u53d8\u91cf\u3001\u547d\u4ee4\u66ff\u6362\u7b49\u4f1a\u88ab\u5c55\u5f00\u3002\u4f8b\u5982 $HOME \u4f1a\u88ab\u89e3\u6790\u6210\u5f53\u524d\u7528\u6237\u4e3b\u76ee\u5f55\u8def\u5f84\u3002<\/li>\n<li>\u5e26\u5f15\u53f7\u7684 \u2018EOF\u2019&#xff1a;\u5185\u5bb9\u5c06\u88ab\u4f5c\u4e3a\u7eaf\u6587\u672c\u5bf9\u5f85&#xff0c;\u4e0d\u4f1a\u505a\u53d8\u91cf\u6216\u547d\u4ee4\u66ff\u6362\u3002<\/li>\n<\/ul>\n<h4>\u5177\u4f53\u6d41\u7a0b<\/h4>\n<li>\u9047\u5230 &lt;&lt;&#039;EOF&#039;&#xff0c;Shell \u8bfb\u5165\u540e\u7eed\u591a\u884c\u6587\u672c&#xff0c;\u76f4\u5230\u9047\u89c1\u4ee5 EOF&#xff08;\u6216\u8005\u4f60\u5b9a\u4e49\u7684\u7ed3\u675f\u6807\u8bb0&#xff09;\u5f00\u59cb\u7684\u90a3\u884c\u3002<\/li>\n<li>\u8fd9\u6bb5\u6587\u672c&#xff08;\u4e2d\u95f4\u7684\u591a\u884c&#xff09;\u90fd\u4f1a\u5f53\u4f5c \u4e00\u6574\u4e2a\u8f93\u5165 \u4f20\u7ed9 command\u3002<\/li>\n<li>\u82e5\u4f7f\u7528 &#039;EOF&#039;&#xff0c;\u5c06\u4e0d\u4f1a\u5bf9\u6587\u672c\u505a\u53d8\u91cf\u6216\u547d\u4ee4\u66ff\u6362&#xff1b;\u82e5\u53ea\u5199 EOF&#xff08;\u65e0\u5355\u5f15\u53f7&#xff09;&#xff0c;\u5219\u4f1a\u8fdb\u884c\u6b63\u5e38\u7684 Shell \u53d8\u91cf\u548c\u547d\u4ee4\u66ff\u6362\u3002<\/li>\n<h4>\u793a\u4f8b<\/h4>\n<p>\u4f8b\u5982<\/p>\n<p><span class=\"token function\">ssh<\/span> user&#064;host <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\ncat \/etc\/passwd<br \/>\necho $HOME<br \/>\nEOF<\/span><\/p>\n<ul>\n<li>cat \/etc\/passwd \u548c echo $HOME \u90fd\u8fd0\u884c\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a&#xff0c;\u4e14\u56e0\u4e3a \u2018EOF\u2019 \u4e0d\u505a\u66ff\u6362&#xff0c;\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u770b\u5230\u7684\u547d\u4ee4\u5b57\u9762\u4e0a\u5c31\u662f cat \/etc\/passwd \u548c echo $HOME\u3002\u5982\u679c\u6ca1\u6709\u5355\u5f15\u53f7\u5199 EOF&#xff0c;\u90a3\u4e9b $HOME \u4e4b\u7c7b\u7684\u53d8\u91cf\u53ef\u80fd\u5728\u672c\u5730\u5c31\u88ab\u66ff\u6362\u4e86\u3002<\/li>\n<\/ul>\n<h2>\u4e94\u3001&lt;&lt;\u2018EOF\u2019 EOF \u4e3a\u4ec0\u4e48\u5e26\u4e0a\u5b83\u5c31\u662f\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7684&#xff0c;\u4e0d\u5e26\u5c31\u662f\u5728\u81ea\u5df1\u670d\u52a1\u5668\u4e0a\u6267\u884c\u7684&#xff1f;<\/h2>\n<p>\u8fd9\u91cc\u5176\u5b9e\u5e76\u4e0d\u662f\u56e0\u4e3a\u5e26\u4e86 &lt;&lt;&#039;EOF&#039; \u5c31\u4e00\u5b9a\u662f\u300c\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u300d&#xff0c;\u800c\u662f \u547d\u4ee4\u5199\u6cd5 \u51b3\u5b9a\u4e86\u8c01\u6765\u89e3\u91ca\u548c\u6267\u884c\u91cd\u5b9a\u5411\u3002\u901a\u5e38\u6709\u4e24\u79cd\u5e38\u89c1\u7684\u573a\u666f&#xff1a;<\/p>\n<hr \/>\n<h3>1. \u5c06\u547d\u4ee4&#xff08;\u542b\u91cd\u5b9a\u5411&#xff09;\u5305\u5728 heredoc \u91cc\u4f20\u7ed9 ssh<\/h3>\n<p><span class=\"token function\">ssh<\/span> user&#064;host <span class=\"token operator\">&lt;&lt;<\/span><span class=\"token string\">&#039;EOF&#039;<br \/>\ncat \/some\/path &gt;&gt; remote.log<br \/>\nEOF<\/span><\/p>\n<ul>\n<li>\u8fd9\u6bb5\u547d\u4ee4\u8fde\u540c\u91cd\u5b9a\u5411\u7b26 &gt;&gt; remote.log \u4e00\u8d77&#xff0c;\u90fd\u4f5c\u4e3a\u6807\u51c6\u8f93\u5165\u4f20\u7ed9 \u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u7684 Shell\u3002<\/li>\n<li>\u6240\u4ee5 cat \/some\/path &gt;&gt; remote.log \u7684\u91cd\u5b9a\u5411\u662f\u5728\u8fdc\u7a0bShell\u89e3\u91ca\u5e76\u6267\u884c&#xff0c;\u65e5\u5fd7\u6587\u4ef6\u5c31\u5199\u5728\u8fdc\u7a0b\u670d\u52a1\u5668\u4e0a\u3002<\/li>\n<\/ul>\n<hr \/>\n<h3>2. \u5728\u672c\u5730 Shell \u4e2d\u5199\u91cd\u5b9a\u5411<\/h3>\n<p><span class=\"token function\">ssh<\/span> user&#064;host <span class=\"token string\">&#034;cat \/some\/path&#034;<\/span> <span class=\"token operator\">&gt;&gt;<\/span> local.log<\/p>\n<ul>\n<li>\u8fd9\u91cc ssh user&#064;host &#034;cat \/some\/path&#034; \u662f\u8fdc\u7a0b\u6267\u884c cat \/some\/path&#xff0c;<\/li>\n<li>\u4f46 &gt;&gt; local.log \u662f \u672c\u5730 Shell \u770b\u5230\u7684&#xff0c;\u6240\u4ee5\u65e5\u5fd7\u8f93\u51fa\u4fdd\u5b58\u5230\u672c\u5730\u3002<\/li>\n<\/ul>\n<hr \/>\n<h4>\u4e3a\u4ec0\u4e48\u4f1a\u51fa\u73b0\u8fd9\u79cd\u73b0\u8c61&#xff1f;<\/h4>\n<ul>\n<li>Shell \u89e3\u6790\u89c4\u5219&#xff1a; \u5f53\u4f60\u5728\u672c\u5730\u7528 ssh user&#064;host &#034;some command&#034; \u65f6&#xff0c;\u5927\u90e8\u5206\u8f6c\u4e49\/\u91cd\u5b9a\u5411\u7b26\u53f7&#xff08;\u5982 &gt;&gt; local.log&#xff09;\u4f1a\u88ab\u672c\u5730 Shell \u5148\u5904\u7406\u6216\u4fdd\u7559&#xff1b;\u53ea\u6709 &#034;some command&#034; \u8fd9\u90e8\u5206\u624d\u4f1a\u9001\u5230\u8fdc\u7a0b\u6267\u884c\u3002<\/li>\n<li>heredoc \u7684\u4f5c\u7528&#xff1a; ssh user&#064;host &lt;&lt;&#039;EOF&#039; \u610f\u5473\u7740\u540e\u7eed\u6240\u6709\u6587\u672c\u90fd\u4f5c\u4e3a\u8f93\u5165\u7ed9 ssh \u547d\u4ee4&#xff1b;\u8fdc\u7a0b Shell \u4f1a\u6536\u5230\u6574\u6bb5\u811a\u672c&#xff0c;\u5305\u542b &gt;&gt; remote.log \u7b49\u7b26\u53f7&#xff0c;\u4e5f\u5c31\u610f\u5473\u7740\u8fdc\u7a0b Shell\u8d1f\u8d23\u6267\u884c\u8fd9\u4e9b\u91cd\u5b9a\u5411\u3002<\/li>\n<li>\u5e26\u4e0d\u5e26 &#039;(\u5355\u5f15\u53f7) \u7684\u5dee\u522b&#xff1a;\n<ul>\n<li>&lt;&lt;EOF&#xff08;\u4e0d\u5e26\u5f15\u53f7&#xff09;\u65f6&#xff0c;\u672c\u5730\u4f1a\u5bf9\u4e2d\u95f4\u90e8\u5206\u505a\u53d8\u91cf\u66ff\u6362&#xff1b;<\/li>\n<li>&lt;&lt;&#039;EOF&#039;&#xff08;\u5e26\u5f15\u53f7&#xff09;\u65f6&#xff0c;\u5219\u628a\u4e2d\u95f4\u7684\u5185\u5bb9\u5f53\u7eaf\u6587\u672c&#xff0c;\u4e0d\u505a\u66ff\u6362\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>\u4f46\u65e0\u8bba\u6709\u6ca1\u6709 &#039;&#xff0c;\u53ea\u8981\u662f\u628a \u91cd\u5b9a\u5411\u5199\u5728 heredoc \u811a\u672c\u91cc&#xff0c;\u5c31\u662f\u8ba9\u8fdc\u7aef\u6765\u6267\u884c&#xff1b;\u53ea\u8981\u662f\u628a\u91cd\u5b9a\u5411\u5199\u5728 ssh user&#064;host &#034;&#8230;&#034; \u5916\u9762&#xff0c;\u5c31\u662f\u5728\u672c\u5730\u6765\u6267\u884c\u3002<\/p>\n<hr \/>\n<h3>\u5c0f\u7ed3<\/h3>\n<ul>\n<li>\u5173\u952e\u5728\u4e8e&#xff1a;\u547d\u4ee4\u548c\u91cd\u5b9a\u5411\u662f\u5728\u8c01\u7684 Shell \u73af\u5883\u4e2d\u88ab\u89e3\u91ca\u3002<\/li>\n<li>Heredoc \u5199\u6cd5\u65f6&#xff0c;\u6574\u6bb5\u811a\u672c&#xff08;\u542b\u91cd\u5b9a\u5411&#xff09;\u4f1a\u9001\u5230\u8fdc\u7aefShell&#xff0c;\u6240\u4ee5\u65e5\u5fd7\u4f1a\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u3002<\/li>\n<li>\u5982\u679c\u91cd\u5b9a\u5411\u7b26\u5199\u5728 ssh user&#064;host &#8230; &gt;&gt; localfile&#xff0c;\u90a3\u4e48\u91cd\u5b9a\u5411\u5c31\u662f\u5728\u672c\u5730Shell\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb860\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4e0a\u6267\u884c\u7684\uff0c\u4e0d\u662f\u5728\u672c\u673a\u6267\u884c\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u60a8\u901a\u8fc7 SSH \u767b\u5f55\u5230\u76ee\u6807\u670d\u52a1\u5668\uff0c\u7136\u540e\u5728\u8be5\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u6307\u5b9a\u7684\u547d\u4ee4\u3002\uff09\u90fd\u5199\u5728 heredoc \u5f53\u4e2d\uff0c\u4f1a\u88ab\u8fdc\u7aef\u7684 Shell \u89e3\u91ca\u5e76\u6267\u884c\uff0c\u6240\u4ee5\u751f\u6210\u6216\u8ffd\u52a0\u65e5\u5fd7\u7684\u3002\u5982\u679c\u5e0c\u671b\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u672c\u5730\uff0c\u9700\u8981\u628a\u91cd\u5b9a\u5411\u7b26\u53f7\u653e\u5728\u672c\u5730 Shell\u3002\u5728\u8fdc\u7a0b\u6267\u884c\uff0c\u4f46\u8f93\u51fa\u6d41\u91cd\u5b9a\u5411\u7531\u672c\u5730 Shell \u5904\u7406\uff0c\u751f\u6210\u7684\u3002\uff08Here Document\uff09\u7684\u5199\u6cd5\u3002\u7684\u64cd\u4f5c\u662f\u7531\u672c\u5730 Shell \u5b8c\u6210\uff0c\u56e0\u6b64\u3002\uff08\u6216\u8005\u4f60\u6307\u5b9a\u7684\u7ed3\u675f\u7b26\u53f7\uff09\u4e4b\u95f4\u7684\u591a\u884c\u6587\u672c\uff0c\u5c31\u4e00\u5b9a\u662f\u300c\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u300d\uff0c\u800c\u662f\u3002\uff09\u4e0a\u6267\u884c\u7684\uff0c\u4f46\u5c06\u5176\u8f93\u51fa\u91cd\u5b9a\u5411\u5199\u5165\u3002<\/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":[77,205,43],"topic":[],"class_list":["post-15339","post","type-post","status-publish","format-standard","hentry","category-server","tag-ssh","tag-tcp-ip","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \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\/15339.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb860\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4e0a\u6267\u884c\u7684\uff0c\u4e0d\u662f\u5728\u672c\u673a\u6267\u884c\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u60a8\u901a\u8fc7 SSH \u767b\u5f55\u5230\u76ee\u6807\u670d\u52a1\u5668\uff0c\u7136\u540e\u5728\u8be5\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u6307\u5b9a\u7684\u547d\u4ee4\u3002\uff09\u90fd\u5199\u5728 heredoc \u5f53\u4e2d\uff0c\u4f1a\u88ab\u8fdc\u7aef\u7684 Shell \u89e3\u91ca\u5e76\u6267\u884c\uff0c\u6240\u4ee5\u751f\u6210\u6216\u8ffd\u52a0\u65e5\u5fd7\u7684\u3002\u5982\u679c\u5e0c\u671b\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u672c\u5730\uff0c\u9700\u8981\u628a\u91cd\u5b9a\u5411\u7b26\u53f7\u653e\u5728\u672c\u5730 Shell\u3002\u5728\u8fdc\u7a0b\u6267\u884c\uff0c\u4f46\u8f93\u51fa\u6d41\u91cd\u5b9a\u5411\u7531\u672c\u5730 Shell \u5904\u7406\uff0c\u751f\u6210\u7684\u3002\uff08Here Document\uff09\u7684\u5199\u6cd5\u3002\u7684\u64cd\u4f5c\u662f\u7531\u672c\u5730 Shell \u5b8c\u6210\uff0c\u56e0\u6b64\u3002\uff08\u6216\u8005\u4f60\u6307\u5b9a\u7684\u7ed3\u675f\u7b26\u53f7\uff09\u4e4b\u95f4\u7684\u591a\u884c\u6587\u672c\uff0c\u5c31\u4e00\u5b9a\u662f\u300c\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u300d\uff0c\u800c\u662f\u3002\uff09\u4e0a\u6267\u884c\u7684\uff0c\u4f46\u5c06\u5176\u8f93\u51fa\u91cd\u5b9a\u5411\u5199\u5165\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/15339.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T13:53:14+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\/15339.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/15339.html\",\"name\":\"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T13:53:14+00:00\",\"dateModified\":\"2025-04-18T13:53:14+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/15339.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/15339.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/15339.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f\"}]},{\"@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":"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \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\/15339.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb860\u6b21\uff0c\u70b9\u8d5e20\u6b21\uff0c\u6536\u85cf22\u6b21\u3002\u4e0a\u6267\u884c\u7684\uff0c\u4e0d\u662f\u5728\u672c\u673a\u6267\u884c\u3002\u7b80\u5355\u6765\u8bf4\uff0c\u60a8\u901a\u8fc7 SSH \u767b\u5f55\u5230\u76ee\u6807\u670d\u52a1\u5668\uff0c\u7136\u540e\u5728\u8be5\u670d\u52a1\u5668\u4e0a\u8fd0\u884c\u6307\u5b9a\u7684\u547d\u4ee4\u3002\uff09\u90fd\u5199\u5728 heredoc \u5f53\u4e2d\uff0c\u4f1a\u88ab\u8fdc\u7aef\u7684 Shell \u89e3\u91ca\u5e76\u6267\u884c\uff0c\u6240\u4ee5\u751f\u6210\u6216\u8ffd\u52a0\u65e5\u5fd7\u7684\u3002\u5982\u679c\u5e0c\u671b\u5c06\u8f93\u51fa\u4fdd\u5b58\u5230\u672c\u5730\uff0c\u9700\u8981\u628a\u91cd\u5b9a\u5411\u7b26\u53f7\u653e\u5728\u672c\u5730 Shell\u3002\u5728\u8fdc\u7a0b\u6267\u884c\uff0c\u4f46\u8f93\u51fa\u6d41\u91cd\u5b9a\u5411\u7531\u672c\u5730 Shell \u5904\u7406\uff0c\u751f\u6210\u7684\u3002\uff08Here Document\uff09\u7684\u5199\u6cd5\u3002\u7684\u64cd\u4f5c\u662f\u7531\u672c\u5730 Shell \u5b8c\u6210\uff0c\u56e0\u6b64\u3002\uff08\u6216\u8005\u4f60\u6307\u5b9a\u7684\u7ed3\u675f\u7b26\u53f7\uff09\u4e4b\u95f4\u7684\u591a\u884c\u6587\u672c\uff0c\u5c31\u4e00\u5b9a\u662f\u300c\u5728\u76ee\u6807\u670d\u52a1\u5668\u4e0a\u6267\u884c\u300d\uff0c\u800c\u662f\u3002\uff09\u4e0a\u6267\u884c\u7684\uff0c\u4f46\u5c06\u5176\u8f93\u51fa\u91cd\u5b9a\u5411\u5199\u5165\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/15339.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T13:53:14+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\/15339.html","url":"https:\/\/www.wsisp.com\/helps\/15339.html","name":"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T13:53:14+00:00","dateModified":"2025-04-18T13:53:14+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/15339.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/15339.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/15339.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u4e91\u539f\u751f\u6280\u672f\u3011ssh usr@ip \u2019cat aa.text\u2018\u662f\u8fdb\u5165\u5230\u76ee\u6807\u670d\u52a1\u5668\u8fd8\u662f\u5728\u81ea\u5df1\u7684\u670d\u52a1\u5668\u6267\u884c\uff1f"}]},{"@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\/15339","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=15339"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/15339\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=15339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=15339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=15339"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=15339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}