【devops】ttyd 一个web版本的shell工具 | web版本shell工具 | web shell

一、什么是 TTYD

ttyd是在web端一个简单的服务器命令行工具

类似我们在云厂商上直接ssh链接我们的服务器输入指令一样

二、安装ttyd

1、macOS

  • Install with Homebrew: brew install ttyd
  • Install with MacPorts: sudo port install ttyd

2、linux

  • Binary version (recommended): download from the releases page
  • Install with Homebrew : brew install ttyd
  • Install the snap: sudo snap install ttyd --classic
  • Build from source (debian/ubuntu):
bash 复制代码
sudo apt-get update
sudo apt-get install -y build-essential cmake git libjson-c-dev libwebsockets-dev
git clone https://github.com/tsl0922/ttyd.git
cd ttyd && mkdir build && cd build
cmake ..
make && sudo make install

You may also need to compile/install libwebsockets from source if the libwebsockets-dev package is outdated.

  • Install on OpenWrt: opkg install ttyd
  • Install on Gentoo: clone the repo and follow the directions here.

3、windows

  • Binary version (recommended): download from the releases page
  • Install with WinGet: winget install tsl0922.ttyd
  • Install with Scoop: scoop install ttyd

三、使用 ttyd

官方文档
https://github.com/tsl0922/ttyd/wiki/Example-Usage

1、使用说明

一定要查看这里的所有说明(如下:)

2、默认启动 客户端无法输入

直接启动指令如下:

bash 复制代码
ttyd -p 8080 bash

这样启动,我们通过客户端访问

这里我们在页面输入啥都不可以!!!

3、包含Basic Auth 且 可修改

bash 复制代码
ttyd -p 8080 -c root:123456-Ab@@ -W bash

4、包含Basic Auth 且 可修改 且 指定ip

bash 复制代码
nohup ttyd  -p 8080 -B 127.0.0.1  -c root:123456-Ab@@ -W bash &
相关推荐
CodeSheep17 分钟前
Stack Overflow,轰然倒下了!
前端·后端·程序员
i紸定i17 分钟前
解决html-to-image在 ios 上dom里面的图片不显示出来
前端·ios·vue·html·html-to-image
ai.Neo19 分钟前
(第十七期)HTML图像标签详解:从入门到精通
前端·html
excel23 分钟前
JS 函数终极指南:this、闭包、递归、尾调用、柯里化,一次性吃透
前端
花小璇学linux23 分钟前
imx6ull-驱动开发篇22——Linux 时间管理和内核定时器
linux·运维·驱动开发
夏天想24 分钟前
html模拟websocket通信
前端
你好,赵志伟2 小时前
Socket 编程 TCP
linux·服务器·tcp/ip
Liang_GaRy3 小时前
心路历程-三个了解敲开linux的大门
linux·运维·服务器
阿珊和她的猫5 小时前
v-scale-scree: 根据屏幕尺寸缩放内容
开发语言·前端·javascript
一只栖枝7 小时前
华为 HCIE 大数据认证中 Linux 命令行的运用及价值
大数据·linux·运维·华为·华为认证·hcie·it