ºìÁªLinuxÃÅ»§
Linux°ïÖú

¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate

·¢²¼Ê±¼ä:2017-12-08 14:25:25À´Ô´:ºìÁª×÷Õß:Ronny
µ¼¶Á ²»¾ÃÇ°£¬ÎÒÃÇд¹ýһƪ¹ØÓÚ teleconsole µÄ½éÉÜ£¬¸Ã¹¤¾ß¿ÉÓÃÓÚ¿ìËÙ·ÖÏíÖն˸øÈκÎÈË£¨ÈκÎÄãÐÅÈεÄÈË£©¡£½ñÌìÎÒÃÇÒªÁÄÒ»ÁÄÁíÒ»¿îÀàËƵÄÓ¦Óã¬Ãû½Ð tmate¡£tmate ÓÐʲôÓã¿Ëü¿ÉÒÔÈÃÄãÔÚÐèÒª°ïÖúʱÏòÄãµÄÅóÓÑÃÇÇóÖú¡£
ʲôÊÇ tmate£¿
tmate µÄÒâ˼ÊÇ teammates£¬ËüÊÇ tmux µÄÒ»¸ö·ÖÖ§£¬²¢ÇÒʹÓÃÏàͬµÄÅäÖÃÐÅÏ¢£¨ÀýÈç¿ì½Ý¼üÅäÖã¬ÅäÉ«·½°¸µÈ£©¡£ËüÊÇÒ»¸öÖն˶à·¸´ÓÃÆ÷£¬Í¬Ê±¾ßÓм´Ê±·ÖÏíÖն˵ÄÄÜÁ¦¡£ËüÔÊÐíÔÚµ¥¸öÆÁÄ»Öд´½¨²¢²Ù¿Ø¶à¸öÖնˣ¬Í¬Ê±ÕâЩÖն˻¹ÄÜÓëÆäËûͬÊ·ÖÏí¡£

Äã¿ÉÒÔ·ÖÀë»á»°£¬ÈÃ×÷ÒµÔÚºǫ́ÔËÐУ¬È»ºóÔÚÏëÒª²é¿´×´Ì¬Ê±ÖØÐÂÁ¬½Ó»á»°¡£tmate ÌṩÁËÒ»¸ö¼´Ê±Åä¶ÔµÄ·½°¸£¬ÈÃÄã¿ÉÒÔÓëÒ»¸ö»ò¶à¸ö¶ÓÓѹ²ÏíÒ»¸öÖնˡ£

ÔÚÆÁÄ»µÄµØ²½ÓÐÒ»¸ö״̬À¸£¬ÏÔʾÁ˵±Ç°»á»°µÄһЩÖîÈç ssh ÃüÁîÖ®ÀàµÄ¹²ÏíÐÅÏ¢¡£

tmate ÊÇÔõô¹¤×÷µÄ£¿
ÔËÐÐ tmate ʱ£¬»áͨ¹ý libssh ÔÚºǫ́´´½¨Ò»¸öÁ¬½Óµ½ tmate.io £¨ÓÉ tmate ¿ª·¢Õßά»¤µÄºǫ́·þÎñÆ÷£©µÄ ssh Á¬½Ó¡£
tmate.io ·þÎñÆ÷µÄ ssh ÃÜԿͨ¹ý DH ½»»»½øÐÐУÑé¡£
¿Í»§¶Ëͨ¹ý±¾µØ ssh ÃÜÔ¿½øÐÐÈÏÖ¤¡£
Á¬½Ó´´½¨ºó£¬±¾µØ tmux ·þÎñÆ÷»áÉú³ÉÒ»¸ö 150 λ(²»¿É²Â²âµÄËæ»ú×Ö·û)»á»°ÁîÅÆ¡£
¶ÓÓÑÄÜͨ¹ýÓû§ÌṩµÄ SSH »á»° ID Á¬½Óµ½ tmate.io¡£

ʹÓà tmate µÄ±Ø±¸Ìõ¼þ
ÓÉÓÚ tmate.io ·þÎñÆ÷ÐèҪͨ¹ý±¾µØ ssh ÃÜÔ¿À´ÈÏÖ¤¿Í»§»ú£¬Òò´ËÆäÖÐÒ»¸ö±Ø±¸Ìõ¼þ¾ÍÊÇÉú³É SSH ÃÜÔ¿ key¡£ ¼Çס£¬Ã¿¸öϵͳ¶¼ÒªÓÐ×Ô¼ºµÄ SSH ÃÜÔ¿¡£

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/magi/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/magi/.ssh/id_rsa.
Your public key has been saved in /home/magi/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:3ima5FuwKbWyyyNrlR/DeBucoyRfdOtlUmb5D214NC8 magi@magi-VirtualBox
The key's randomart image is:
+---[RSA 2048]----+
| |
| |
| . |
| . . = o |
| *ooS= . + o |
| . =.@*o.o.+ E .|
| =o==B++o = . |
| o.+*o+.. . |
| ..o+o=. |
+----[SHA256]-----+
ÈçºÎ°²×° tmate
tmate ÒѾ­°üº¬ÔÚijЩ·¢ÐаæµÄ¹Ù·½²Ö¿âÖУ¬¿ÉÒÔͨ¹ý°ü¹ÜÀíÆ÷À´°²×°¡£

¶ÔÓÚ Debian/Ubuntu£¬¿ÉÒÔʹÓà APT-GET ÃüÁî»òÕß APT ÃüÁîto À´°²×°¡£

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:tmate.io/archive
$ sudo apt-get update
$ sudo apt-get install tmate
ÄãÒ²¿ÉÒÔ´Ó¹Ù·½²Ö¿âÖа²×° tmate¡£

$ sudo apt-get install tmate
¶ÔÓÚ Fedora£¬Ê¹Óà DNF ÃüÁî À´°²×°¡£

$ sudo dnf install tmate
¶ÔÓÚ»ùÓÚ Arch Linux µÄϵͳ£¬Ê¹Óà Yaourt ÃüÁî»ò Packer ÃüÁî À´´Ó AUR ²Ö¿âÖа²×°¡£

$ yaourt -S tmate
»ò

$ packer -S tmate
¶ÔÓÚ openSUSE£¬Ê¹Óà Zypper ÃüÁî À´°²×°¡£

$ sudo zypper in tmate
ÈçºÎʹÓà tmate
³É¹¦°²×°ºó£¬´ò¿ªÖÕ¶ËÈ»ºóÊäÈëÏÂÃæÃüÁ¾Í»á´ò¿ªÒ»¸öеĻỰ£¬ÔÚÆÁÄ»µ×²¿£¬ÄãÄÜ¿´µ½ SSH »á»°µÄ ID¡£

$ tmate
¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate
ҪעÒâµÄÊÇ£¬SSH »á»° ID »áÔÚ¼¸ÃëºóÏûʧ£¬²»¹ý²»Òª½ô£¬Äã¿ÉÒÔͨ¹ýÏÂÃæÃüÁî»ñÈ¡µ½ÕâЩÏêϸÐÅÏ¢¡£

$ tmate show-messages
tmate µÄ show-messages ÃüÁî»áÏÔʾ tmate µÄÈÕÖ¾ÐÅÏ¢£¬ÆäÖаüº¬Á˸à ssh Á¬½ÓÄÚÈÝ¡£

¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate



ÏÖÔÚ£¬·ÖÏíÄãµÄ SSH »á»° ID ¸øÄãµÄÅóÓÑ»òͬÊ´ӶøÔÊÐíËûÃǹۿ´Öն˻Ự¡£³ýÁË SSH »á»° ID ÒÔÍ⣬ÄãÒ²¿ÉÒÔ·ÖÏí web URL¡£

ÁíÍâÄ㻹¿ÉÒÔÑ¡Ôñ·ÖÏíµÄÊÇÖ»¶Á»á»°»¹ÊǿɶÁд»á»°¡£

ÈçºÎͨ¹ý SSH Á¬½Ó»á»°
Ö»ÐèÒªÔÚÖÕ¶ËÉÏÔËÐÐÄã´ÓÅóÓÑÄǵõ½µÄ SSH ÖÕ¶Ë ID ¾ÍÐÐÁË¡£ÀàËÆÏÂÃæÕâÑù¡£

$ ssh session: ssh 3KuRj95sEZRHkpPtc2y6jcokP@sg2.tmate.io
¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate

ÈçºÎͨ¹ý Web URL Á¬½Ó»á»°
´ò¿ªä¯ÀÀÆ÷È»ºó·ÃÎÊÅóÓѸøÄãµÄ URL ¾ÍÐÐÁË¡£ÏñÏÂÃæÕâÑù¡£

¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate



Ö»ÐèÒªÊäÈë exit ¾ÍÄÜÍ˳ö»á»°ÁË¡£

[Source System Output]
[exited]
[Remote System Output]
[server exited]
Connection to sg2.tmate.io closed by remote host¡£
Connection to sg2.tmate.io closed¡£
±¾ÎÄתÔØ×Ô£ºhttp://www.linuxprobe.com/quickly-share-tmate.html

Ãâ·ÑÌṩ×îÐÂLinux¼¼Êõ½Ì³ÌÊé¼®£¬Îª¿ªÔ´¼¼Êõ°®ºÃÕßŬÁ¦×öµÃ¸ü¶à¸üºÃ£¬¿ªÔ´Õ¾µã£ºhttp://www.linuxprobe.com/
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 1 ÌõÆÀÂÛ

  1. Ronny ÓÚ 2017-12-08 14:25:38·¢±í:

    ¿ìËÙÖն˻Ự·ÖÏí¹¤¾ß:tmate