{"id":89293,"date":"2024-02-20T01:39:11","date_gmt":"2024-02-19T17:39:11","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=89293"},"modified":"2024-02-20T01:39:11","modified_gmt":"2024-02-19T17:39:11","slug":"quickly-share-tmate","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/quickly-share-tmate.html","title":{"rendered":"\u5feb\u901f\u7ec8\u7aef\u4f1a\u8bdd\u5206\u4eab\u5de5\u5177:tmate"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4e0d\u4e45\u524d\uff0c\u6211\u4eec\u5199\u8fc7\u4e00\u7bc7\u5173\u4e8e teleconsole \u7684\u4ecb\u7ecd\uff0c\u8be5\u5de5\u5177\u53ef\u7528\u4e8e\u5feb\u901f\u5206\u4eab\u7ec8\u7aef\u7ed9\u4efb\u4f55\u4eba\uff08\u4efb\u4f55\u4f60\u4fe1\u4efb\u7684\u4eba\uff09\u3002\u4eca\u5929\u6211\u4eec\u8981\u804a\u4e00\u804a\u53e6\u4e00\u6b3e\u7c7b\u4f3c\u7684\u5e94\u7528\uff0c\u540d\u53eb tmate\u3002tmate \u6709\u4ec0\u4e48\u7528\uff1f\u5b83\u53ef\u4ee5\u8ba9\u4f60\u5728\u9700\u8981\u5e2e\u52a9\u65f6\u5411\u4f60\u7684\u670b\u53cb\u4eec\u6c42\u52a9\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
\u4ec0\u4e48\u662f tmate\uff1f<\/strong><\/div>\n

tmate \u7684\u610f\u601d\u662f teammates\uff0c\u5b83\u662f tmux \u7684\u4e00\u4e2a\u5206\u652f\uff0c\u5e76\u4e14\u4f7f\u7528\u76f8\u540c\u7684\u914d\u7f6e\u4fe1\u606f\uff08\u4f8b\u5982\u5feb\u6377\u952e\u914d\u7f6e\uff0c\u914d\u8272\u65b9\u6848\u7b49\uff09\u3002\u5b83\u662f\u4e00\u4e2a\u7ec8\u7aef\u591a\u8def\u590d\u7528\u5668\uff0c\u540c\u65f6\u5177\u6709\u5373\u65f6\u5206\u4eab\u7ec8\u7aef\u7684\u80fd\u529b\u3002\u5b83\u5141\u8bb8\u5728\u5355\u4e2a\u5c4f\u5e55\u4e2d\u521b\u5efa\u5e76\u64cd\u63a7\u591a\u4e2a\u7ec8\u7aef\uff0c\u540c\u65f6\u8fd9\u4e9b\u7ec8\u7aef\u8fd8\u80fd\u4e0e\u5176\u4ed6\u540c\u4e8b\u5206\u4eab\u3002<\/p>\n

\u4f60\u53ef\u4ee5\u5206\u79bb\u4f1a\u8bdd\uff0c\u8ba9\u4f5c\u4e1a\u5728\u540e\u53f0\u8fd0\u884c\uff0c\u7136\u540e\u5728\u60f3\u8981\u67e5\u770b\u72b6\u6001\u65f6\u91cd\u65b0\u8fde\u63a5\u4f1a\u8bdd\u3002tmate \u63d0\u4f9b\u4e86\u4e00\u4e2a\u5373\u65f6\u914d\u5bf9\u7684\u65b9\u6848\uff0c\u8ba9\u4f60\u53ef\u4ee5\u4e0e\u4e00\u4e2a\u6216\u591a\u4e2a\u961f\u53cb\u5171\u4eab\u4e00\u4e2a\u7ec8\u7aef\u3002<\/p>\n

\u5728\u5c4f\u5e55\u7684\u5730\u6b65\u6709\u4e00\u4e2a\u72b6\u6001\u680f\uff0c\u663e\u793a\u4e86\u5f53\u524d\u4f1a\u8bdd\u7684\u4e00\u4e9b\u8bf8\u5982 ssh \u547d\u4ee4\u4e4b\u7c7b\u7684\u5171\u4eab\u4fe1\u606f\u3002<\/p>\n

tmate \u662f\u600e\u4e48\u5de5\u4f5c\u7684\uff1f<\/strong><\/div>\n

\u8fd0\u884c tmate \u65f6\uff0c\u4f1a\u901a\u8fc7 libssh \u5728\u540e\u53f0\u521b\u5efa\u4e00\u4e2a\u8fde\u63a5\u5230 tmate.io \uff08\u7531 tmate \u5f00\u53d1\u8005\u7ef4\u62a4\u7684\u540e\u53f0\u670d\u52a1\u5668\uff09\u7684 ssh \u8fde\u63a5\u3002
\ntmate.io \u670d\u52a1\u5668\u7684 ssh \u5bc6\u94a5\u901a\u8fc7 DH \u4ea4\u6362\u8fdb\u884c\u6821\u9a8c\u3002
\n\u5ba2\u6237\u7aef\u901a\u8fc7\u672c\u5730 ssh \u5bc6\u94a5\u8fdb\u884c\u8ba4\u8bc1\u3002
\n\u8fde\u63a5\u521b\u5efa\u540e\uff0c\u672c\u5730 tmux \u670d\u52a1\u5668\u4f1a\u751f\u6210\u4e00\u4e2a 150 \u4f4d(\u4e0d\u53ef\u731c\u6d4b\u7684\u968f\u673a\u5b57\u7b26)\u4f1a\u8bdd\u4ee4\u724c\u3002
\n\u961f\u53cb\u80fd\u901a\u8fc7\u7528\u6237\u63d0\u4f9b\u7684 SSH \u4f1a\u8bdd ID \u8fde\u63a5\u5230 tmate.io\u3002<\/p>\n

\u4f7f\u7528 tmate \u7684\u5fc5\u5907\u6761\u4ef6<\/strong><\/div>\n

\u7531\u4e8e tmate.io \u670d\u52a1\u5668\u9700\u8981\u901a\u8fc7\u672c\u5730 ssh \u5bc6\u94a5\u6765\u8ba4\u8bc1\u5ba2\u6237\u673a\uff0c\u56e0\u6b64\u5176\u4e2d\u4e00\u4e2a\u5fc5\u5907\u6761\u4ef6\u5c31\u662f\u751f\u6210 SSH \u5bc6\u94a5 key\u3002 \u8bb0\u4f4f\uff0c\u6bcf\u4e2a\u7cfb\u7edf\u90fd\u8981\u6709\u81ea\u5df1\u7684 SSH \u5bc6\u94a5\u3002<\/p>\n

$ ssh-keygen -t rsa\r\nGenerating public\/private rsa key pair.\r\nEnter file in which to save the key (\/home\/magi\/.ssh\/id_rsa): \r\nEnter passphrase (empty for no passphrase): \r\nEnter same passphrase again: \r\nYour identification has been saved in \/home\/magi\/.ssh\/id_rsa.\r\nYour public key has been saved in \/home\/magi\/.ssh\/id_rsa.pub.\r\nThe key fingerprint is:\r\nSHA256:3ima5FuwKbWyyyNrlR\/DeBucoyRfdOtlUmb5D214NC8 magi@magi-VirtualBox\r\nThe key's randomart image is:\r\n+---[RSA 2048]----+\r\n|                 |\r\n|                 |\r\n|           .     |\r\n|      . . =   o  |\r\n|     *ooS= . + o |\r\n|  . =.@*o.o.+ E .|\r\n|   =o==B++o  = . |\r\n|  o.+*o+..    .  |\r\n| ..o+o=.         |\r\n+----[SHA256]-----+\r\n<\/pre>\n
\u5982\u4f55\u5b89\u88c5 tmate<\/strong><\/div>\n

tmate \u5df2\u7ecf\u5305\u542b\u5728\u67d0\u4e9b\u53d1\u884c\u7248\u7684\u5b98\u65b9\u4ed3\u5e93\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5305\u7ba1\u7406\u5668\u6765\u5b89\u88c5\u3002<\/p>\n

\u5bf9\u4e8e Debian\/Ubuntu\uff0c\u53ef\u4ee5\u4f7f\u7528 APT-GET \u547d\u4ee4\u6216\u8005 APT \u547d\u4ee4to \u6765\u5b89\u88c5\u3002<\/p>\n

$ sudo apt-get install software-properties-common\r\n$ sudo add-apt-repository ppa:tmate.io\/archive\r\n$ sudo apt-get update\r\n$ sudo apt-get install tmate\r\n<\/pre>\n

\u4f60\u4e5f\u53ef\u4ee5\u4ece\u5b98\u65b9\u4ed3\u5e93\u4e2d\u5b89\u88c5 tmate\u3002<\/p>\n

$ sudo apt-get install tmate\r\n<\/pre>\n

\u5bf9\u4e8e Fedora\uff0c\u4f7f\u7528 DNF \u547d\u4ee4 \u6765\u5b89\u88c5\u3002<\/p>\n

$ sudo dnf install tmate\r\n<\/pre>\n

\u5bf9\u4e8e\u57fa\u4e8e Arch Linux \u7684\u7cfb\u7edf\uff0c\u4f7f\u7528 Yaourt \u547d\u4ee4\u6216 Packer \u547d\u4ee4 \u6765\u4ece AUR \u4ed3\u5e93\u4e2d\u5b89\u88c5\u3002<\/p>\n

$ yaourt -S tmate\r\n<\/pre>\n

\u6216<\/p>\n

$ packer -S tmate\r\n<\/pre>\n

\u5bf9\u4e8e openSUSE\uff0c\u4f7f\u7528 Zypper \u547d\u4ee4 \u6765\u5b89\u88c5\u3002<\/p>\n

$ sudo zypper in tmate\r\n<\/pre>\n
\u5982\u4f55\u4f7f\u7528 tmate<\/strong><\/div>\n

\u6210\u529f\u5b89\u88c5\u540e\uff0c\u6253\u5f00\u7ec8\u7aef\u7136\u540e\u8f93\u5165\u4e0b\u9762\u547d\u4ee4\uff0c\u5c31\u4f1a\u6253\u5f00\u4e00\u4e2a\u65b0\u7684\u4f1a\u8bdd\uff0c\u5728\u5c4f\u5e55\u5e95\u90e8\uff0c\u4f60\u80fd\u770b\u5230 SSH \u4f1a\u8bdd\u7684 ID\u3002<\/p>\n

$ tmate\r\n\"\"\r\n<\/pre>\n

\u8981\u6ce8\u610f\u7684\u662f\uff0cSSH \u4f1a\u8bdd ID \u4f1a\u5728\u51e0\u79d2\u540e\u6d88\u5931\uff0c\u4e0d\u8fc7\u4e0d\u8981\u7d27\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u547d\u4ee4\u83b7\u53d6\u5230\u8fd9\u4e9b\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n

$ tmate show-messages\r\n<\/pre>\n

tmate \u7684 show-messages \u547d\u4ee4\u4f1a\u663e\u793a tmate \u7684\u65e5\u5fd7\u4fe1\u606f\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u8be5 ssh \u8fde\u63a5\u5185\u5bb9\u3002<\/p>\n

\"\"<\/p>\n

 <\/p>\n

\u73b0\u5728\uff0c\u5206\u4eab\u4f60\u7684 SSH \u4f1a\u8bdd ID \u7ed9\u4f60\u7684\u670b\u53cb\u6216\u540c\u4e8b\u4ece\u800c\u5141\u8bb8\u4ed6\u4eec\u89c2\u770b\u7ec8\u7aef\u4f1a\u8bdd\u3002\u9664\u4e86 SSH \u4f1a\u8bdd ID \u4ee5\u5916\uff0c\u4f60\u4e5f\u53ef\u4ee5\u5206\u4eab web URL\u3002<\/p>\n

\u53e6\u5916\u4f60\u8fd8\u53ef\u4ee5\u9009\u62e9\u5206\u4eab\u7684\u662f\u53ea\u8bfb\u4f1a\u8bdd\u8fd8\u662f\u53ef\u8bfb\u5199\u4f1a\u8bdd\u3002<\/p>\n

\u5982\u4f55\u901a\u8fc7 SSH \u8fde\u63a5\u4f1a\u8bdd<\/strong><\/div>\n

\u53ea\u9700\u8981\u5728\u7ec8\u7aef\u4e0a\u8fd0\u884c\u4f60\u4ece\u670b\u53cb\u90a3\u5f97\u5230\u7684 SSH \u7ec8\u7aef ID \u5c31\u884c\u4e86\u3002\u7c7b\u4f3c\u4e0b\u9762\u8fd9\u6837\u3002<\/p>\n

$ ssh session: ssh 3KuRj95sEZRHkpPtc2y6jcokP@sg2.tmate.io\r\n<\/pre>\n

\"\"<\/p>\n

\u5982\u4f55\u901a\u8fc7 Web URL \u8fde\u63a5\u4f1a\u8bdd<\/strong><\/div>\n

\u6253\u5f00\u6d4f\u89c8\u5668\u7136\u540e\u8bbf\u95ee\u670b\u53cb\u7ed9\u4f60\u7684 URL \u5c31\u884c\u4e86\u3002\u50cf\u4e0b\u9762\u8fd9\u6837\u3002<\/p>\n

\"\"<\/p>\n

 <\/p>\n

\u53ea\u9700\u8981\u8f93\u5165 exit \u5c31\u80fd\u9000\u51fa\u4f1a\u8bdd\u4e86\u3002<\/p>\n

[Source System Output]\r\n[exited]\r\n[Remote System Output]\r\n[server exited]\r\nConnection to sg2.tmate.io closed by remote host\u3002\r\nConnection to sg2.tmate.io closed\u3002\r\n<\/pre>\n

 <\/p>\n

via: https:\/\/www.2daygeek.com\/tmate-instantly-share-your-terminal-session-to-anyone-in-seconds\/<\/a><\/p>\n

\u4f5c\u8005\uff1a[Magesh Maruthamuthu][a] \u8bd1\u8005\uff1alujun9972<\/a> \u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531 LCTT<\/a> \u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a> \u8363\u8a89\u63a8\u51fa<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttps:\/\/linux.cn\/article-9096-1.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/quickly-share-tmate.html<\/a>\u7f16\u8f91\uff1a\u51af\u745e\u6d9b\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u4e0d\u4e45\u524d\uff0c\u6211\u4eec\u5199\u8fc7\u4e00\u7bc7\u5173\u4e8e teleconsole \u7684\u4ecb\u7ecd\uff0c\u8be5\u5de5\u5177\u53ef\u7528\u4e8e\u5feb\u901f\u5206\u4eab\u7ec8\u7aef\u7ed9\u4efb\u4f55\u4eba\uff08\u4efb\u4f55\u4f60\u4fe1\u4efb\u7684 […]<\/p>\n","protected":false},"author":1329,"featured_media":89303,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-89293","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/89293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1329"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=89293"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/89293\/revisions"}],"predecessor-version":[{"id":89305,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/89293\/revisions\/89305"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/89303"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=89293"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=89293"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=89293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}