{"id":1309,"date":"2022-07-05T16:27:13","date_gmt":"2022-07-05T08:27:13","guid":{"rendered":"https:\/\/yowlab.idv.tw\/wordpress\/?p=1309"},"modified":"2026-01-17T22:54:24","modified_gmt":"2026-01-17T14:54:24","slug":"ssh-%e5%8f%8d%e5%90%91%e9%80%a3%e6%8e%a5%ef%bc%88%e5%8f%8d%e5%90%91%e9%9a%a7%e9%81%93%ef%bc%89%e8%a8%ad%e7%bd%ae%e6%b3%95","status":"publish","type":"post","link":"https:\/\/yowlab.idv.tw\/wordpress\/?p=1309","title":{"rendered":"SSH \u53cd\u5411\u9023\u63a5\uff08\u53cd\u5411\u96a7\u9053\uff09\u8a2d\u7f6e\u6cd5"},"content":{"rendered":"<p>\u70ba\u4e86\u8cc7\u5b89\u76ee\u524d\u5927\u90e8\u5206\u7684\u7684\u6a5f\u5668\u90fd\u90fd\u653e\u7f6e\u5728\u9632\u706b\u7246\u5e95\u4e0b\uff0c\u53ea\u5141\u8a31\u5167\u90e8\u4e3b\u52d5\u9023\u51fa\u53bb\uff0c\u4f46\u4e0d\u5141\u8a31\u5916\u90e8\u9023\u63a5\u9032\u4f86\u3002<\/p>\n<p>\u4e0d\u904e\u73fe\u5be6\u4e16\u754c\u5c31\u662f\u6703\u6709\u4e00\u4e9b\u81e8\u6642\u6027\u7684\u4f8b\u5916\uff0c\u6b64\u6642\u4fbf\u53ef\u4ee5\u5229\u7528\u300c\u8a2d\u7f6e ssh \u53cd\u5411\u9023\u63a5\u300d\u4f86\u89e3\u6c7a\u9019\u500b\u77ed\u66ab\u9700\u6c42\u3002<\/p>\n<style type=\"text\/css\">\n    li.present01 {line-height:1.5em; background-color:#F5E5C9; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}\n    li.present02 {line-height:1.5em; background-color:#D1EC87; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}<\/p>\n<p>    ul.none {list-style-type:none;line-height:1.5em; padding:10px;}\n    ol.lower-roman {list-style-type:lower-roman;}\n    ul.note {line-height:1.5em; padding:2px; font-weight:bold; font-size:0.9em;}\n    .highlight01 {font-weight:bold; line-height:1.5em; background-color:#e7f49c; padding:2px 10px; border:2px soild; border-radius:10px;}\n    .highlight02 {font-weight:bold; line-height:1.5em; background-color:#F2F26B; padding:2px 10px; border:2px soild; border-radius:10px;}\n    .highlight03 {font-weight:bold; line-height:1.5em; background-color:#DFAB66; padding:2px 10px; border:2px soild; border-radius:10px;}\n    .box01 {margin: 5px; border:1px #19130B solid; border-radius:5px; padding:10px;}\n    .box02 {margin: 5px; font-weight:bold; line-height:1.5em; padding:10px; border:1px #19130B solid; border-radius:5px; float: left;}\n    h3 {border:2px #000 solid; border-width:0px 0px 1px 0px; padding-width:0px 0px 3px 0px;}<\/p>\n<\/style>\n<p>\u6982\u5ff5\u5982\u4e0b\u5716\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/ssh01.png\" alt=\"\" width=\"1058\" height=\"595\" class=\"alignnone size-full wp-image-1311\" srcset=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/ssh01.png 1058w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/ssh01-350x197.png 350w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/ssh01-1024x576.png 1024w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/ssh01-768x432.png 768w\" sizes=\"auto, (max-width: 1058px) 100vw, 1058px\" \/><\/p>\n<ol>\n<li class=\"present01\">\u9632\u706b\u7246\u5916\u7684\u6a5f\u5668\uff0c\u6b63\u5e38\u72c0\u6cc1\u7121\u6cd5\u9023\u7dda\u5230\u9632\u706b\u7246\u5f8c\u9762\u7684\u6a5f\u5668\uff0c\u5982<span class=\"highlight03\">\u300c\u7d05\u7dda\u300d<\/span>\u6240\u793a\uff0c\u9023\u7dda\u90fd\u88ab\u9632\u706b\u7246\u64cb\u4e0b\u3002<\/li>\n<li class=\"present01\">\u672c\u6587\u91cd\u9ede\u6240\u5728\uff0c\u8b93\u9632\u706b\u7246\u5167\u6a5f\u5668\uff08\u4f8b\uff1a192.192.100.1\uff09<span class=\"highlight03\">\u5148\u300c\u4e3b\u52d5\u300d\u9023\u63a5\uff08\u5496\u5561\u8272\u5be6\u7dda\uff09<\/span>\u5230\u9632\u706b\u7246\u5916\u7684\u67d0\u90e8\u6a5f\u5668\uff08\u4f8b\uff1a192.168.100.1\uff09\uff0c\u85c9\u6b64\u9023\u7dda<span class=\"highlight03\">\u540c\u6642\u300c\u88ab\u52d5\u300d\u7684\u5efa\u51fa\u4e00\u689d\u5c08\u5c6c\u9023\u7dda\uff08\u5496\u5561\u8272\u865b\u7dda\uff09<\/span>\uff0c\u9019\u689d\u9023\u7dda\u5c31\u7a31\u70ba\u300c\u53cd\u5411\u9023\u7dda\u300d\uff08\u53cd\u5411\u96a7\u9053\uff09\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3>\u5be6\u4f5c\u958b\u59cb<\/h3>\n<ol>\n<li class=\"present01\">\u78ba\u8a8d\u300c\u9632\u706b\u7246\u5167\u6a5f\u5668\uff08\u4f8b\uff1a192.192.100.1\uff09\u300d\u53ef\u4ee5 ssh \u767b\u5165 \u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\uff08\u4f8b\uff1a192.168.100.1\uff09\u300d\u3002\uff08\u6b64\u70ba\u300c\u6b63\u5411\u9023\u7dda\u300d\uff09<\/li>\n<li class=\"present01\">\u5efa\u7acb\u53cd\u5411\u9023\u7dda<\/li>\n<p>            \u5728\u300c\u9632\u706b\u7246\u5167\u6a5f\u5668\uff08\u4f8b\uff1a192.192.100.1\uff09\u300d\u57f7\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u76ee\u7684\u662f\u8ddf\u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\uff08\u4f8b\uff1a192.168.100.1\uff09\u300d\u5efa\u7acb\u53cd\u5411\u9023\u7dda\u3002<\/p>\n<div class=\"box01\">\n              \u5b8c\u6574\u8a9e\u6cd5\u662f\uff1a<br \/>\n              <span class=\"highlight01\">ssh -NfR  \u9060\u7aef\u4e3b\u6a5f A:3209:\u60f3\u9023\u4e0a\u4e3b\u6a5fB:22  \u5e33\u865f@\u9060\u7aef\u4e3b\u6a5f A <\/span><\/p>\n<p>              \u800c\uff0c\u6211\u5011\u9019\u88e1\u5247\u5beb\u6210\uff1a<br \/>\n              <span class=\"highlight01\">ssh -NfR 3209:localhost:22  \u5e33\u865f@192.168.100.1 <\/span>    <\/p>\n<p>             \u8aaa\u660e\uff1a<br \/>\n                -N \u53c3\u6578\uff1a\u8868\u793a\u53ea\u9023\u7dda\u9060\u7aef\u4e3b\u6a5f\uff0c\u4e0d\u958b\u555f\u9060\u7aef shell\u3002<\/p>\n<p>                -f \u53c3\u6578\uff1a\u8868\u793a ssh \u9023\u7dda\u6210\u529f\u5f8c\uff0c\u8f49\u5165\u80cc\u666f\u57f7\u884c\u3002\u9019\u6a23\u4e00\u4f86\uff0c\u5c31\u53ef\u4ee5\u5728\u4e0d\u4e2d\u65b7 ssh \u9023\u7dda\u7684\u60c5\u6cc1\u4e0b\uff0c\u5728\u672c\u5730\u7aef\u4e2d\u9032\u884c\u5176\u4ed6\u64cd\u4f5c\u3002<\/p>\n<p>                -R \u53c3\u6578\uff1a\u8868\u9762\u4e0a R \u53c3\u6578\u662f\u63a5\u53d7\u4e09\u500b\u503c\uff0c\u5206\u5225\u662f\u300c\u9060\u7aef\u4e3b\u6a5fA\u57e0\u865f:\u60f3\u9023\u4e0a\u4e3b\u6a5fB:\u60f3\u9023\u4e0a\u4e3b\u6a5fB\u57e0\u865f\u300d\uff083209:localhost:22\uff09\u3002<\/p>\n<p>                   \u4e8b\u5be6\u4e0a\u5b8c\u6574\u5beb\u6cd5\u662f\u5169\u5927\u6bb5\uff0c <span class=\"highlight01\">\u9060\u7aef\u4e3b\u6a5f A:\u57e0\u865f<\/span>:<span class=\"highlight01\">\u60f3\u9023\u4e0a\u4e3b\u6a5f B:\u57e0\u865f<\/span>\uff0c\u800c<span class=\"highlight01\">\u9060\u7aef\u4e3b\u6a5f A:\u57e0\u865f<\/span>\u4e2d\u7684<span class=\"highlight01\">\u9060\u7aef\u4e3b\u6a5f A<\/span>\u53ef\u4ee5\u7701\u7565\uff0c\u6240\u4ee5\u5c31\u8b8a\u6210\u73fe\u5728\u6163\u898b\u7684\u4e09\u500b\u503c\u300c\u9060\u7aef\u4e3b\u6a5f\u57e0\u865f:\u60f3\u9023\u4e0a\u4e3b\u6a5f:\u60f3\u9023\u4e0a\u4e3b\u6a5f\u57e0\u865f\u300d\u3002<\/p>\n<p>                   \u53e6\u5916\uff0c\u60f3\u9023\u4e0a\u4e3b\u6a5f\uff0c\u53ef\u4ee5\u662f\u76ee\u524d\u6b63\u767b\u5165\u7684\u9019\u90e8\u4e3b\u6a5f\uff08192.168.100.1)\u672c\u8eab\uff0c\u6240\u4ee5\u9019\u88e1\u7528\u300clocalhost\u300d\u3002\u4e5f\u53ef\u4ee5\u662f\u5176\u4ed6\u7684\u4e3b\u6a5f\uff0c\u800c\u82e5\u662f\u5176\u4ed6\u7684\u4e3b\u6a5f\uff0c\u5c31\u8981\u63db\u6210\u5176\u4ed6\u4e3b\u6a5f\u7684 IP \u3002<\/p>\n<p>                   \u5728\u9019\u88e1\u9060\u7aef\u4e3b\u6a5f\u57e0 3209\uff0c\u6307\u7684\u662f\u4e00\u65e6\u5efa\u7acb\u53cd\u5411\u9023\u7dda\u6210\u529f\uff0c\u4fbf\u6703\u5728\u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\uff08\u4f8b\uff1a192.168.100.1\uff09\u300d\u4e0a\u958b\u555f 3209 \u57e0\uff0c\u7136\u5f8c\u8b93\u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\uff08\u4f8b\uff1a192.168.100.1\uff09\u300d\u76e3\u807d\u5b83\u81ea\u5df1\u7684 3209 \u57e0\u3002<\/p>\n<p>                   \u800c localhost:22 \u7684\u610f\u601d\uff0c\u662f\u6307\u60f3\u9023\u4e0a\u7684\u4e3b\u6a5f\u662f\u76ee\u524d\u767b\u5165\u7684\u9019\u90e8\u4e3b\u6a5f\u81ea\u5df1\uff08localhost , 192.192.100.1\uff09\uff0c\u4e5f\u5c31\u662f\u53ea\u8981\u662f\u5f9e\u9060\u7aef\u4e3b\u6a5f3209\u57e0\u51fa\u4f86\u7684\u8cc7\u6599\uff0c\u5c31\u6703\u5168\u90e8\u7531 \u76ee\u524d\u9019\u90e8\u4e3b\u6a5f\uff08localhost\uff09 22 \u57e0 \u8f49\u9032\u4f86\u3002<\/p>\n<p>                  \u82e5\u662f\u60f3\u9023\u4e0a\u7684\u4e3b\u6a5f\u662f\u5176\u4ed6\u6a5f\u5668\u7684 22 \u57e0\uff0c\u5247\u90a3\u90e8\u6a5f\u5668\u5247\u8981\u80fd\u5920\u4ee5 ssh \u767b\u5165\u3002<\/p>\n<p>             <span class=\"highlight01\">\u4e0d\u4e00\u5b9a\u8981\u300c3209\u300d\u57e0\uff0c\u53ea\u8981\u662f\u5408\u6cd5\u4e14\u9592\u7f6e\u7684\u57e0\uff0c\u90fd\u53ef\u4ee5\u4f7f\u7528\u3002<\/span><\/p>\n<p>                 \u6240\u4ee5\u5b8c\u6574\u7684\u547d\u4ee4\u61c9\u8a72\u662f\uff1a<span class=\"highlight01\">ssh -NfR  192.192.100.1:3209:localhost:22  \u5e33\u865f@192.168.100.1 <\/span> \uff0c\u9060\u7aef\u4e3b\u6a5f 192.168.100.1 \u7701\u7565\u6389\u4e86\uff01\n            <\/div\n\n\n\n<p>&nbsp;<\/p>\n<li class=\"present01\">\u9632\u706b\u7246\u5916\u6a5f\u5668\u5982\u4f55\u9023\u56de\u9632\u706b\u7246\u5167\u7684\u6a5f\u5668<\/li>\n<div class=\"box01\">\n             \u8a9e\u6cd5\uff1a<br \/>\n              <span class=\"highlight01\">ssh  \u5e33\u865f@localhost -p 3209 <\/span><\/p>\n<p>             \u8aaa\u660e\uff1a<br \/>\n               \u5e33\u865f\u662f\u300c\u9632\u706b\u7246\u5167\u6a5f\u5668\uff08\u4f8b\uff1a192.192.100.1\uff09\u300d\u4e0a\u80fd\u4ee5 ssh \u767b\u5165\u7684\u771f\u5be6\u5e33\u865f\u3002<\/p>\n<p>               -p 3209 \uff1a3209 \u662f\u4e00\u958b\u59cb\u5efa\u7acb\u53cd\u5411\u9023\u7dda\u6642\u8a2d\u5b9a\u7684\u57e0\u865f\u3002\n            <\/p><\/div>\n<p>&nbsp;<\/p>\n<li class=\"present01\"> \u5728\u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\u300d\u4e0a\uff0c\u82e5\u60f3 scp\u300c\u9632\u706b\u7246\u5167\u7684\u6a5f\u5668\u300d\u4e0a\u7684\u6a94\u6848?    <\/li>\n<div class=\"box01\">\n             \u8a9e\u6cd5\uff1a<br \/>\n              <span class=\"highlight01\">scp -P 3209 \u5e33\u865f@localhost:\/(\u76ee\u9304)\/\u6a94\u6848    .\/<\/span><\/p>\n<p>             \u8aaa\u660e\uff1a<br \/>\n               -P 3209\uff1a\u6ce8\u610f\u662f\u5927\u5beb\u7684P\uff0c3209 \u662f\u4e00\u958b\u59cb\u5efa\u7acb\u53cd\u5411\u9023\u7dda\u6642\u8a2d\u5b9a\u7684\u57e0\u865f\u3002<\/p><\/div>\n<p>&nbsp;<\/p>\n<li class=\"present01\"> \u5916\u90e8\u4e3b\u6a5f\u82e5\u60f3 scp\u300c\u9632\u706b\u7246\u5167\u7684\u6a5f\u5668\u300d\u4e0a\u7684\u6a94\u6848?    <\/li>\n<div class=\"box01\">\n             \u8a9e\u6cd5\uff1a<br \/>\n              <span class=\"highlight01\">scp -J \u5e33\u865f@\u9632\u706b\u7246\u6a5f\u5668IP -P 3209  \u5e33\u865f@localhost:\/(\u76ee\u9304)\/\u6a94\u6848    .\/<\/span><\/p>\n<p>             \u8aaa\u660e\uff1a<br \/>\n               -P 3209\uff1a\u6ce8\u610f\u662f\u5927\u5beb\u7684P\uff0c3209 \u662f\u4e00\u958b\u59cb\u5efa\u7acb\u53cd\u5411\u9023\u7dda\u6642\u8a2d\u5b9a\u7684\u57e0\u865f\u3002<\/p><\/div>\n<p>&nbsp;<\/p>\n<li class=\"present01\"> \u5728\u300c\u9632\u706b\u7246\u5916\u6a5f\u5668\u300d\u4e0a\uff0c\u82e5\u60f3 rsync\u300c\u9632\u706b\u7246\u5167\u7684\u6a5f\u5668\u300d\u4e0a\u7684\u6a94\u6848?    <\/li>\n<div class=\"box01\">\n             \u8a9e\u6cd5\uff1a<br \/>\n              <span class=\"highlight01\">rsync -avz -e &#8216;ssh -p 3209&#8217;  \u5e33\u865f@localhost:\/(\u76ee\u9304)\/\u6a94\u6848   .\/<\/span><\/p>\n<p>              \u8aaa\u660e\uff1a <\/p>\n<p>              \u900f\u904e\u4f7f\u7528 -e \u53c3\u6578\u3002 <\/p>\n<p>              -e \u53c3\u6578\u5176\u7528\u9014\u662f\u6307\u5b9a\u9060\u7aef\u767b\u5165\u6240\u8981\u4f7f\u7528\u7684\u6307\u4ee4\uff0c\u9810\u8a2d\u7684\u6307\u4ee4\u5c31\u662f ssh\uff0c\u800c\u9019\u88e1\u6211\u5011\u5c07\u6307\u4ee4\u8b8a\u66f4\u70ba ssh -p 3209\uff0c\u4e5f\u5c31\u662f\u4f7f\u7528 3209 \u9019\u500b\u9023\u63a5\u57e0\u767b\u5165 ssh \u7684\u610f\u601d\uff0c\u53ef\u8a73\u7d30\u53c3\u8003 ssh \u6307\u4ee4\u7684 -p \u53c3\u6578\u7528\u6cd5\u3002   <\/p><\/div>\n<p>&nbsp;<\/p>\n<li class=\"present01\"> \u5916\u90e8\u4e3b\u6a5f\u82e5\u60f3 rsync\u300c\u9632\u706b\u7246\u5167\u7684\u6a5f\u5668\u300d\u4e0a\u7684\u6a94\u6848?    <\/li>\n<div class=\"box01\">\n             \u8a9e\u6cd5\uff1a<br \/>\n              <span class=\"highlight01\">rsync -avz -e &#8216;ssh -J \u5e33\u865f@\u9632\u706b\u7246\u6a5f\u5668IP -p 3209 &#8216; \u5e33\u865f@localhost:\/(\u76ee\u9304)\/\u6a94\u6848   .\/<\/span><\/p>\n<p>              \u8aaa\u660e\uff1a <\/p>\n<p>              \u900f\u904e\u4f7f\u7528 -e \u53c3\u6578\u3002 <\/p>\n<p>              -e \u53c3\u6578\u5176\u7528\u9014\u662f\u6307\u5b9a\u9060\u7aef\u767b\u5165\u6240\u8981\u4f7f\u7528\u7684\u6307\u4ee4\uff0c\u9810\u8a2d\u7684\u6307\u4ee4\u5c31\u662f ssh\uff0c\u800c\u9019\u88e1\u6211\u5011\u5c07\u6307\u4ee4\u8b8a\u66f4\u70ba ssh -p 3209\uff0c\u4e5f\u5c31\u662f\u4f7f\u7528 3209 \u9019\u500b\u9023\u63a5\u57e0\u767b\u5165 ssh \u7684\u610f\u601d\uff0c\u53ef\u8a73\u7d30\u53c3\u8003 ssh \u6307\u4ee4\u7684 -p \u53c3\u6578\u7528\u6cd5\u3002   <\/p><\/div>\n<p>&nbsp;<\/p>\n<li class=\"present01\"> \u5982\u4f55\u907f\u514d ssh \u65b7\u7dda <\/li>\n<p>             \u70ba\u4e86\u5b89\u5168\u8d77\u898b\uff0cssh \u9023\u7dda\u6642\uff0c\u5728\u4e00\u5b9a\u6642\u9593\u5167\u82e5\u7121\u52d5\u4f5c\uff0c\u9810\u8a2d\u503c\u662f\u300c\u5f37\u5236\u65b7\u7dda\u300d\u3002<\/p>\n<p>             \u82e5\u4e0d\u60f3\u65b7\u7dda\u9020\u6210\u56f0\u64fe\uff0c\u6709\u5169\u7a2e\u4f5c\u6cd5\uff1a<\/p>\n<ul>\n<li class=\"present02\">SSH Client<\/li>\n<p>                   \u82e5\u53ea\u60f3\u91dd\u5c0d\u67d0\u4e00\u4f7f\u7528\u8005\uff0c\u53ea\u8981\u5728\u8a72\u4f7f\u7528\u8005\u7684<span class=\"highlight01\"> ~\/.ssh\/config  <\/span>\u6a94\u6848\uff0c\u52a0\u5165\u5e95\u4e0b\u5169\u884c\u3002<\/p>\n<div class=\"box01\">\n                   \u8981\u6ce8\u610f<span class=\"highlight01\"> \u7b2c\u4e8c\u884c\u958b\u59cb\u7684\u4f4d\u7f6e, \u5fc5\u9808\u50cf\u4e0a\u9762\u4e00\u6a23\u52a0\u4e0a\u7a7a\u683c<\/span>\u3002<\/p>\n<p>                     Host *<br \/>\n                     ServerAliveInterval 100<\/p><\/div>\n<p>&nbsp;<\/p>\n<p>                  \u82e5\u60f3\u5c0d\u5168\u90e8\u4f7f\u7528\u8005\u7684\u8a71\uff0c\u5728<span class=\"highlight01\"> \/etc\/ssh\/ssh_config  <\/span>\u6a94\u6848\u52a0\u5165\u4e00\u884c\uff1a<\/p>\n<div class=\"box01\">\n                     ServerAliveInterval 100\n            <\/div>\n<p>&nbsp;<\/p>\n<li class=\"present02\">SSH Server<\/li>\n<p>                  \u4fee\u6539\u6216\u7de8\u8f2f<span class=\"highlight01\"> \/etc\/ssh\/sshd_config <\/span>\u6a94\u6848\uff1a<\/p>\n<div class=\"box01\">\n                  ClientAliveInterval 60<br \/>\n                  ClientAliveCountMax 3<br \/>\n                  #\u6bcf60\u79d2\u81ea\u52d5\u50b3\u90013\u500b\u8a0a\u865f\u7d66client,\u800c\u7b49\u5f85client\u56de\u61c9\n            <\/div>\n<\/ul>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3>\u53c3\u8003\u8cc7\u6e90<\/h3>\n<ol>\n<li>ssh\u7528\u6cd5\u53ca\u547d\u4ee4<\/li>\n<p>            <a href=\"https:\/\/codertw.com\/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80\/508094\/\" rel=\"noopener\" target=\"_blank\">https:\/\/codertw.com\/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80\/508094\/<\/a><\/p>\n<li>SSH \u7528\u6cd5\u8fdb\u9636 \u2014\u2014 \u514d\u5bc6\u767b\u5f55\u4e0e\u7aef\u53e3\u8f6c\u53d1  <\/li>\n<p>            <a href=\"https:\/\/icebergu.com\/archives\/ssh\" rel=\"noopener\" target=\"_blank\">https:\/\/icebergu.com\/archives\/ssh<\/a><\/p>\n<div class=\"box01\">\n<ul>\n<li>\u8fdc\u7a0b\u8f6c\u53d1\u662f\u6307\u5c06\u53d1\u9001\u5230\u8fdc\u7aef\u4e3b\u673a\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u672c\u5730\u7684\u76ee\u6807\u7aef\u53e3<\/li>\n<p>                ssh -Nf -R <\u8fdc\u7a0b\u4e3b\u673a\u5730\u5740>:<\u8fdc\u7a0b\u4e3b\u673a\u7aef\u53e3>:<\u672c\u5730\u76ee\u6807\u5730\u5740>:<\u672c\u5730\u76ee\u6807\u7aef\u53e3> <user>@<remote-ip><\/p>\n<p>              \u5728\u672c\u5730\u6267\u884c ssh \u8fdc\u7a0b\u8f6c\u53d1\u547d\u4ee4\uff0c\u8bbf\u95ee <\u8fdc\u7a0b\u4e3b\u673a\u5730\u5740>:<\u8fdc\u7a0b\u4e3b\u673a\u7aef\u53e3>\u65f6\uff0c\u8bf7\u6c42\u4f1a\u8f6c\u53d1\u5230\u672c\u5730<\u672c\u5730\u76ee\u6807\u5730\u5740>:<\u672c\u5730\u76ee\u6807\u7aef\u53e3><\/p>\n<p>              <\u8fdc\u7a0b\u4e3b\u673a\u5730\u5740>: \u53ef\u4ee5\u7701\u7565\uff0c\u9ed8\u8ba4\u4e3a 127.0.0.1\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u4e3a 0.0.0.0 \u5728\u6240\u6709\u7f51\u5361\u4e0a\u5efa\u7acb\u8f6c\u53d1 \u8f6c\u53d1\u8fdc\u7a0b\u4e3b\u673a\u7684\u975e localhost ip \u65f6\uff0c\u9700\u8981\u4fee\u6539 \/etc\/ssh\/sshd_config<\/p>\n<li>ssh -Nf R 10022:localhost:22 iceber@<remote-ip>  <\/li>\n<p>                 \u5c06\u8fdc\u7a0b\u4e3b\u673a\u7684 localhost:10022 \u7aef\u53e3\u63a5\u6536\u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u672c\u5730 localhost:22 \u4e2d\uff0c\u8fd9\u65f6\u5728\u5916\u7f51\u767b\u5f55\u8fdc\u7a0b\u4e3b\u673a\uff0c\u7136\u540e ssh -p 10022 @localhost \u5c31\u53ef\u4ee5\u767b\u5f55\u5230\u5c40\u57df\u7f51\u4e2d\u4e86\u3002<\/p>\n<\/ul><\/div>\n<li>\u9632\u6b62 SSH \u9023\u7dda\u903e\u6642\u65b7\u7dda<\/li>\n<p>            <a href=\"https:\/\/www.ltsplus.com\/linux\/disable-ssh-timeout\" rel=\"noopener\" target=\"_blank\">https:\/\/www.ltsplus.com\/linux\/disable-ssh-timeout<\/a><\/p>\n<li>A visual guide to SSH tunnels<\/li>\n<p>            <a href=\"https:\/\/robotmoon.com\/ssh-tunnels\/\" rel=\"noopener\" target=\"_blank\">https:\/\/robotmoon.com\/ssh-tunnels\/<\/a><\/p>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u70ba\u4e86\u8cc7\u5b89\u76ee\u524d\u5927\u90e8\u5206\u7684\u7684\u6a5f\u5668\u90fd\u90fd\u653e\u7f6e\u5728\u9632\u706b\u7246\u5e95\u4e0b\uff0c\u53ea\u5141\u8a31\u5167\u90e8\u4e3b\u52d5\u9023\u51fa\u53bb\uff0c\u4f46\u4e0d\u5141\u8a31\u5916\u90e8 <a class=\"more-link\" href=\"https:\/\/yowlab.idv.tw\/wordpress\/?p=1309\">Continue reading <span class=\"screen-reader-text\">  SSH \u53cd\u5411\u9023\u63a5\uff08\u53cd\u5411\u96a7\u9053\uff09\u8a2d\u7f6e\u6cd5<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[54],"class_list":["post-1309","post","type-post","status-publish","format-standard","hentry","category-3","category-4","tag-ssh"],"_links":{"self":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1309","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1309"}],"version-history":[{"count":28,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1309\/revisions"}],"predecessor-version":[{"id":3608,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1309\/revisions\/3608"}],"wp:attachment":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1309"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1309"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1309"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}