Skip to main content

tmate

apk add -X https://mirrors.aliyun.com/alpine/edge/testing/ tmate
tmate

# 注册后可使用固定名字
tmate -k API_KEY -n session-name
# 固定 URL
ssh username/session-name@nyc1.tmate.io

配置

# 授权
# tmate -a ~/.ssh/authorized_keys
set tmate-authorized-keys "~/.ssh/authorized_keys"
# 注册时的 API KEY
# -k
set tmate-api-key "API_KEY"
# 链接时用的会话名字
# -n
set tmate-session-name "session-name"

服务端

envvaluedesc
SSH_KEYS_PATHssh key
HAS_WEBSOCKET1tmate-websocket server exists (for HTML5 clients).
USE_PROXY_PROTOCOL1behind a load balancer that uses the proxy protocol enabled. This is useful to get client real IPs.
SSH_HOSTNAMEconfigures the SSH hostname to advertise to tmate hosts.
SSH_PORT_LISTENport on which the SSH server should listen on.
SSH_PORT_ADVERTISE默认 SSH_PORT_LISTEN
# 修改 ~/.tmate.conf 使用自定义的 server
set -g tmate-server-host "ssh.tmate.io"
set -g tmate-server-port 22
set -g tmate-server-rsa-fingerprint "SHA256:Hthk2T/M/Ivqfk1YYUn5ijC2Att3+UPzD7Rn72P5VWs"
set -g tmate-server-ed25519-fingerprint "SHA256:jfttvoypkHiQYUqUCwKeqd9d1fJj/ZiQlFOHVl6E9sI"