{"id":73,"date":"2008-01-02T21:36:51","date_gmt":"2008-01-02T13:36:51","guid":{"rendered":"http:\/\/blog.urdada.net\/2008\/01\/02\/73\/"},"modified":"2008-01-27T10:34:50","modified_gmt":"2008-01-27T02:34:50","slug":"ssh-escape-character","status":"publish","type":"post","link":"https:\/\/dada.tw\/blog\/2008\/01\/02\/73\/","title":{"rendered":"SSH Escape Character"},"content":{"rendered":"<p>SSH client \u6709\u4e00\u500b Escape Character (\u8df3\u812b\u5b57\u5143)\uff0c\u4e8b\u5be6\u4e0a rsh\/rlogin \u4e5f\u6709\u652f\u63f4 Escape Character (~)\uff0c\u5c31\u5982\u540c Ctrl-] \u4e4b\u65bc telnet \u4e00\u6a23&#8230;<\/p>\n<p>SSH client \u7684 Escape Character \u4e00\u822c\u8ddf rsh\/rlogin \u4e00\u6a23\u8a2d\u5b9a\u6210 ~\uff0c\u8a73\u7d30\u7528\u6cd5\u53ef\u65bc\u547d\u4ee4\u5217\u6309 ~? \u4f86\u53d6\u5f97\u8aaa\u660e\uff0c\u8981\u6ce8\u610f\u7684\u662f\uff0c\u70ba\u4e86\u907f\u514d\u5f71\u97ff\u4e00\u822c\u6b63\u5e38\u7684\u8f38\u5165\uff0cEscape Character \u5fc5\u9808\u662f<u>\u547d\u4ee4\u5217\u63db\u884c\u5f8c\u7684\u7b2c\u4e00\u500b\u6309\u9375<\/u>\uff0c\u5982\u679c\u4f60\u5df2\u7d93\u8f38\u5165\u5225\u7684\u6309\u9375\uff0c\u5373\u4f7f\u6309 backspace \u628a\u6e38\u6a19\u79fb\u56de\u958b\u982d\u8655\u518d\u8f38\u5165 Escape Character \u4e5f\u662f\u7121\u6548\u7684\uff01\u8acb\u5148\u6309 Enter \u63db\u884c\u5f8c\u518d\u8f38\u5165\u5427\uff01<\/p>\n<pre class=mono>\r\nmyhost# ~?\r\nSupported escape sequences:\r\n~.  - terminate connection\r\n~B  - send a BREAK to the remote system\r\n~C  - open a command line\r\n~R  - Request rekey (SSH protocol 2 only)\r\n~^Z - suspend ssh\r\n~#  - list forwarded connections\r\n~&  - background ssh (when waiting for connections to terminate)\r\n~?  - this message\r\n~~  - send the escape character by typing it twice\r\n(Note that escapes are only recognized immediately after newline.)\r\n<\/pre>\n<p>\u6700\u5e38\u7528\u7684 Escape Character \u5c31\u662f ~. \u4ee5\u53ca ~^Z \u9019\u5169\u500b\uff1a<\/p>\n<p>~. \u662f\u76f4\u63a5\u5207\u65b7\u76ee\u524d\u7684 SSH \u9023\u7dda\uff0c\u5982\u679c\u4f60\u9047\u5230\u9060\u7aef\u6a5f\u5668\u6c92\u6709\u53cd\u61c9\u6642\uff0c\u53ef\u7528\u6b64\u65b9\u5f0f\u4f86\u5207\u65b7\u9023\u7dda<\/p>\n<p>~^Z (~ \u53ca Ctrl-Z) \u5247\u662f\u628a\u76ee\u524d\u7684 SSH \u9023\u7dda\u5148 suspend\uff0c\u4e00\u822c\u53ef\u7528\u4f86\u56de\u5230\u539f\u4f86\u6a5f\u5668\u4e0a\u8655\u7406\u4e00\u4e9b\u4e8b\u60c5\uff0c\u82e5\u8981\u518d\u56de\u53bb\uff0c\u8f38\u5165 fg \u5373\u53ef<\/p>\n<p>\u554f\u984c\u4f86\u4e86\uff0c\u5047\u8a2d\u4f60\u5f9e HOST1 \u5148 SSH \u5230 HOST2\uff0c\u7136\u5f8c\u518d\u5f9e HOST2 SSH \u5230 HOST3<\/p>\n<p>HOST1 ===1===> HOST2 ===2===> HOST3<\/p>\n<p>\u5982\u679c\u4f60\u5728 HOST3 \u7684 terminal \u4e0b\u8f38\u5165 ~. \u7684\u8a71\uff0c\u4f60\u6703\u76f4\u63a5\u5207\u65b7\u4e0a\u9762\u7684\u7b2c\u4e00\u6bb5\u9023\u7dda\u56de\u5230 HOST1 \u7684 terminal\uff0c\u7576\u7136\u9019\u6a23\u7684\u8a71\u7b2c\u4e8c\u6bb5\u9023\u7dda\u4e5f\u4e00\u4f75 bye-bye \u4e86\uff01\u5982\u679c\u53ea\u662f\u60f3\u5207\u65b7\u7b2c\u4e8c\u6bb5\u9023\u7dda\u56de\u5230 HOST2 \u8a72\u600e\u9ebc\u4f5c\u5462\uff1f<\/p>\n<p>\u9019\u6642\u5019 ~~ \u5c31\u767c\u63ee\u4f5c\u7528\u4e86\uff0c\u4f60\u53ea\u8981\u8f38\u5165 ~~. \u5c31\u53ef\u4ee5\u5207\u65b7\u7b2c\u4e8c\u6bb5\u9023\u7dda\u4e86<\/p>\n<p>\u4ee5\u6b64\u7d2f\u63a8\uff0c\u8f38\u5165 N \u500b Escape Character \u4ee3\u8868\u5c0d\u7b2c N \u6bb5\u9023\u7dda\u9001\u51fa Escape Character<\/p>\n<p>\u6700\u5f8c\uff0c\u82e5\u4e0d\u60f3\u7528 ~ \u7576\u4f5c\u8df3\u812b\u5b57\u5143\uff0c\u53ef\u65bc\u547d\u4ee4\u5217\u7528 -e \u4fee\u6539\uff0c\u4f8b\u5982\u628a SSH \u8df3\u812b\u5b57\u5143\u6539\u6210 #\uff1a<\/p>\n<pre class=mono>\r\nssh -e \"#\" myhost.mydomain.com\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>SSH client \u6709\u4e00\u500b Escape Character (\u8df3\u812b\u5b57\u5143)\uff0c\u4e8b\u5be6\u4e0a rsh\/rlogin \u4e5f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[11,4],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","hentry","category-software","category-security"],"views":6178,"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pubdi-1b","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":36,"url":"https:\/\/dada.tw\/blog\/2005\/03\/25\/36\/","url_meta":{"origin":73,"position":0},"title":"\u4f7f\u7528 SSH \u914d\u5408\u6191\u8b49\u4f86\u9060\u7aef\u8907\u88fd\u6a94\u6848 (scp)","author":"dada","date":"2005-03-25","format":false,"excerpt":"\u4ee5\u4e0b\u6574\u7406 UNIX \u7cfb\u7d71\u4e0a\u9762\u4f7f\u7528 SSH \u914d\u5408\u6191\u8b49\u4f86\u9060\u7aef\u8907\u88fd\u6a94\u6848 \u5047\u8a2d\u6709\u4e00\u53f0\u4e3b\u6a5f\u53eb\u505a X\uff0c\u591a\u53f0\u8981\u88ab\u8907\u2026","rel":"","context":"\u5728\u300c\u8cc7\u8a0a\u5b89\u5168\u300d\u4e2d","block_context":{"text":"\u8cc7\u8a0a\u5b89\u5168","link":"https:\/\/dada.tw\/blog\/category\/comp\/security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":70,"url":"https:\/\/dada.tw\/blog\/2008\/01\/03\/70\/","url_meta":{"origin":73,"position":1},"title":"SSH2 vs OpenSSH","author":"dada","date":"2008-01-03","format":false,"excerpt":"\u5e38\u898b\u7684 SSH Implementation \u6709\u5169\u7a2e\uff0cssh.com \u7684 SSH \u4ee5\u53ca OpenSS\u2026","rel":"","context":"\u5728\u300c\u8cc7\u8a0a\u5b89\u5168\u300d\u4e2d","block_context":{"text":"\u8cc7\u8a0a\u5b89\u5168","link":"https:\/\/dada.tw\/blog\/category\/comp\/security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":41,"url":"https:\/\/dada.tw\/blog\/2007\/07\/23\/41\/","url_meta":{"origin":73,"position":2},"title":"[\u7834\u89e3] \u6253\u958b La Fonera \u7684 SSH \u5c01\u5370","author":"dada","date":"2007-07-23","format":false,"excerpt":"\u53bb\u5e74\u5e95\u8cb7\u4e86\u5169\u53f0 La Fonera\uff0c\u5e78\u904b\u7684\u662f\u5169\u53f0\u90fd\u662f\u7528 165\u5143\u5c31\u8cb7\u5230\u4e86\uff0c\u4f46\u4e0d\u5e78\u7684\u662f\u7576\u4e86\u767d\u8001\u9f20\uff0c\u9019\u5169\u2026","rel":"","context":"\u5728\u300c\u786c\u9ad4\u300d\u4e2d","block_context":{"text":"\u786c\u9ad4","link":"https:\/\/dada.tw\/blog\/category\/comp\/hardware\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":75,"url":"https:\/\/dada.tw\/blog\/2008\/01\/07\/75\/","url_meta":{"origin":73,"position":3},"title":"SSH Keyboard-Interactive Authentication","author":"dada","date":"2008-01-07","format":false,"excerpt":"\u6709\u4e9b SSH clients \uff08\u4f8b\u5982: SecureCRT\uff09\u5141\u8a31\u4f7f\u7528\u8005\u300c\u5132\u5b58\u300d\u5bc6\u78bc\uff0c\u9019\u5c0d\u7cfb\u7d71\u5b89\u5168\u662f\u500b\u2026","rel":"","context":"\u5728\u300c\u8cc7\u8a0a\u5b89\u5168\u300d\u4e2d","block_context":{"text":"\u8cc7\u8a0a\u5b89\u5168","link":"https:\/\/dada.tw\/blog\/category\/comp\/security\/"},"img":{"alt_text":"SSH keyboard-interactive authentication","src":"https:\/\/i0.wp.com\/farm3.static.flickr.com\/2181\/2174161870_58d7f2dbaa.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":35,"url":"https:\/\/dada.tw\/blog\/2005\/03\/29\/35\/","url_meta":{"origin":73,"position":4},"title":"\u4f7f\u7528 SSH \u914d\u5408\u6191\u8b49\u4f86\u9060\u7aef\u5099\u4efd\u6a94\u6848 (rsync)","author":"dada","date":"2005-03-29","format":false,"excerpt":"\u524d\u9762\u5beb\u4e86\u4e00\u7bc7\u300c\u4f7f\u7528 SSH \u914d\u5408\u6191\u8b49\u4f86\u9060\u7aef\u8907\u88fd\u6a94\u6848\u300d \u7c21\u4ecb\u4f7f\u7528 scp \u914d\u5408 ssh \u4f86\u9060\u7aef\u8907\u88fd\u6a94\u6848\u2026","rel":"","context":"\u5728\u300c\u8cc7\u8a0a\u5b89\u5168\u300d\u4e2d","block_context":{"text":"\u8cc7\u8a0a\u5b89\u5168","link":"https:\/\/dada.tw\/blog\/category\/comp\/security\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":60,"url":"https:\/\/dada.tw\/blog\/2007\/11\/01\/60\/","url_meta":{"origin":73,"position":5},"title":"La Fonera 0.7.2 r2 \u5347\u7d1a+SSH\u7834\u89e3","author":"dada","date":"2007-11-01","format":false,"excerpt":"[update on Dec 5, 2007] Warning: kolofonium may no\u2026","rel":"","context":"\u5728\u300c\u786c\u9ad4\u300d\u4e2d","block_context":{"text":"\u786c\u9ad4","link":"https:\/\/dada.tw\/blog\/category\/comp\/hardware\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":0,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"wp:attachment":[{"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dada.tw\/blog\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}