ttyd(1) User Manual ttyd(1) (NAME) ttyd - (SYNOPSIS) ttyd [] <> [<...>] (DESCRIPTION) ttyd *nix Windows : o Libwebsockets libuv o Xterm.js CJK ( ) IME o ZMODEM lrzsz o Sixel o SSL OpenSSL o o (Basic Authentication) o : macOS Linux FreeBSD/OpenBSD OpenWrt/LEDE Windows (OPTIONS) -p, --port (: 7681 0 ) -i, --interface (: eth0) (: /var/run/ttyd.sock) -U, --socket-owner (: user:group) -c, --credential USER[:PASSWORD] (: username:password) -H, --auth-header HTTP ttyd HTTP -u, --uid (UID) -g, --gid (GID) -s, --signal (: 1 SIGHUP) -w, --cwd -a, --url-arg URL (: http://localhost:7681?arg=foo&arg=bar) -W, --writable TTY ( ) -t, --client-option (: key=value) (CLIENT OPTIONS) -T, --terminal-type : xterm-256color -O, --check-origin (different origin) -m, --max-clients (: 0 ) -o, --once -q, --exit-no-conn -B, --browser -I, --index index.html -b, --base-path (: /mounted/here : 128) -P, --ping-interval (: 5) -6, --ipv6 IPv6 -S, --ssl SSL -C, --ssl-cert SSL -K, --ssl-key SSL -A, --ssl-ca CA SSL -d, --debug (: 7) -v, --version -h, --help (CLIENT OPTIONS) ttyd (client options) : -t, --client-option (: key=value) (BASIC USAGE) o -t rendererType=canvas: canvas xterm.js (: webgl) o -t disableLeaveAlert=true: o -t disableResizeOverlay=true: o -t disableReconnect=true: o -t enableZmodem=true: ZMODEM / lrzsz o -t enableTrzsz=true: trzsz o -t enableSixel=true: Sixel ( ) o -t titleFixed=hello: o -t fontSize=20: (ADVANCED USAGE) xterm ITerminalOptions : : o -t cursorStyle=bar: bar o -t lineHeight=1.5: (line-height) 1.5 o -t 'theme={"background": "green"}': green : ttyd -t cursorStyle=bar -t lineHeight=1.5 -t 'theme={"background": "green"}' bash (EXAMPLES) ttyd 7681 -p . : ttyd -p 8080 bash -x http://localhost:8080 bash . : o ttyd login . o ( vim) ttyd vim vim . o : ttyd tmux new -A -s ttyd vim tmux tmux new -A -s ttyd . SSL (SSL HOW-TO) CA SSL : # CA certificate (FQDN must be different from server/client) openssl genrsa -out ca.key 2048 openssl req -new -x509 -days 365 -key ca.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=Acme Root CA" -out ca.crt # server certificate (for multiple domains, change subjectAltName to: DNS:example.com,DNS:www.example.com) openssl req -newkey rsa:2048 -nodes -keyout server.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=localhost" -out server.csr openssl x509 -sha256 -req -extfile <(printf "subjectAltName=DNS:localhost") -days 365 -in server.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out server.crt # client certificate (the p12/pem format may be useful for some clients) openssl req -newkey rsa:2048 -nodes -keyout client.key -subj "/C=CN/ST=GD/L=SZ/O=Acme, Inc./CN=client" -out client.csr openssl x509 -req -days 365 -in client.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out client.crt openssl pkcs12 -export -clcerts -in client.crt -inkey client.key -out client.p12 openssl pkcs12 -in client.p12 -out client.pem -clcerts ttyd : ttyd --ssl --ssl-cert server.crt --ssl-key server.key --ssl-ca ca.crt bash curl(1) : curl --insecure --cert client.p12[:password] -v https://localhost:7681 --ssl-ca . ttyd (DOCKER AND TTYD) ttyd : o : docker run -it --rm -p 7681:7681 tsl0922/ttyd. o : ttyd docker run -it --rm ubuntu. (NGINX REVERSE PROXY) ttyd /ttyd: location ~ ^/ttyd(.*)$ { proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://127.0.0.1:7681/$1; } (AUTHORS) Shuanglei Tao . ttyd September 2016 ttyd(1)