【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 &
相关推荐
会飞的爱迪生31 分钟前
mac连接linux服务器
linux·服务器·macos
三月七(爱看动漫的程序员)3 小时前
模型/O功能之提示词模板
java·前端·javascript·人工智能·语言模型·langchain·prompt
LCG元4 小时前
Vue.js组件开发-实现左侧浮动菜单跟随页面滚动
前端·javascript·vue.js
玥轩_5214 小时前
《Linux服务与安全管理》| 数据库服务器安装和配置
linux·运维·服务器·数据库·安全·网络安全·redhat
深度Linux4 小时前
探秘Linux IO虚拟化:virtio的奇幻之旅
linux·c/c++·virtio·虚拟化技术
江湖有缘4 小时前
Linux系统之whereis命令的基本使用
linux·运维·服务器
老大白菜4 小时前
在 Ubuntu 中使用 Conda 创建和管理虚拟环境
linux·ubuntu·conda
山海青风4 小时前
OpenAI 实战进阶教程 - 第四节: 结合 Web 服务:构建 Flask API 网关
前端·人工智能·python·chatgpt·flask
捡破烂的加菲猫5 小时前
Zookeeper入门部署(单点与集群)
linux·分布式·zookeeper
monstercl6 小时前
ubuntu磁盘扩容
linux·运维·ubuntu·磁盘扩容