Tip: if you wish to use tmate only for remote access, run: tmate -F [0/0] To see the following messages again, run in a tmate session: tmate show-messages Press <q> or <ctrl-c> to continue --------------------------------------------------------------------- Connecting to ssh.tmate.io... Note: clear your terminal before sharing readonly access web session read only: https://tmate.io/t/ro-86Kbnayp3sU5zm8HZcNUGKxB4 ssh session read only: ssh ro-86Kbnayp3sU5zm8HZcNUGKxB4@sgp1.tmate.io web session: https://tmate.io/t/ZkWhcPLmKA7wDhc7PzUgNCBHs ssh session: ssh ZkWhcPLmKA7wDhc7PzUgNCBHs@sgp1.tmate.io # 以上是四种连接方式 ssh、ssh-ro、web和web-ro。其中,ssh、web支持读写访问,ssh-ro、web-ro支持只读访问。
root@ubuntu18-108:~# w 16:07:02 up 4:00, 1 user, load average: 0.00, 0.01, 0.00 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT feiyang pts/0 192.168.1.125 12:08 0.00s 0.07s 0.01s sshd: feiyang] root@ubuntu18-108:~# ls go snap tmate-2.4.0-static-linux-amd64 root@ubuntu18-108:~# exit logout[lost server] Connection to sgp1.tmate.io closed by remote host. Connection to sgp1.tmate.io closed.
启动tmate使用如下命令:当启用 public key 访问控制的时候,web 连接方式就无法使用了。
1 2 3 4
tmate -a ~/.ssh/authorized_keys
# A 添加了 public key 的才能成功访问 ssh 8yjGDpk3Vh79xm9rM2QMbKPZj@sgp1.tmate.io
如果 C 没有保存公钥到 A 的~/.ssh/authorized_keys文件中,访问就会被拒绝
1 2 3 4 5 6
ssh 8yjGDpk3Vh79xm9rM2QMbKPZj@sgp1.tmate.io The authenticity of host 'sgp1.tmate.io (188.166.207.127)' can't be established. RSA key fingerprint is SHA256:Hthk2T/M/Ivqfk1YYUn5ijC2Att3+UPzD7Rn72P5VWs. Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'sgp1.tmate.io,188.166.207.127' (RSA) to the list of known hosts. 8yjGDpk3Vh79xm9rM2QMbKPZj@sgp1.tmate.io: Permission denied (publickey).