【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):
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、默认启动 客户端无法输入

直接启动指令如下:

ttyd -p 8080 bash

这样启动,我们通过客户端访问
在这里插入图片描述

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

3、包含Basic Auth 且 可修改

ttyd -p 8080 -c root:123456-Ab@@ -W bash

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

nohup ttyd  -p 8080 -B 127.0.0.1  -c root:123456-Ab@@ -W bash &

相关推荐

  1. 一个C++版本web服务器

    2024-07-18 05:10:03       30 阅读
  2. shell脚本--基础版本

    2024-07-18 05:10:03       60 阅读
  3. linux shell脚本分享!一个系统信息查询工具箱

    2024-07-18 05:10:03       54 阅读
  4. git版本管理工具

    2024-07-18 05:10:03       29 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-18 05:10:03       70 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-18 05:10:03       74 阅读
  3. 在Django里面运行非项目文件

    2024-07-18 05:10:03       62 阅读
  4. Python语言-面向对象

    2024-07-18 05:10:03       72 阅读

热门阅读

  1. Swift 数据类型

    2024-07-18 05:10:03       24 阅读
  2. 入门C语言只需一个星期(星期二)

    2024-07-18 05:10:03       23 阅读
  3. 国产大模型体验:DeepSeek、Kimi与智谱清言

    2024-07-18 05:10:03       22 阅读
  4. 雅思词汇及发音积累 2024.7.17

    2024-07-18 05:10:03       29 阅读
  5. PHP开发工具:打造高效的编码体验

    2024-07-18 05:10:03       22 阅读
  6. 理解 App Store 审核规则 3.2(f):预防被拒绝的方法

    2024-07-18 05:10:03       24 阅读
  7. VINS介绍

    2024-07-18 05:10:03       27 阅读
  8. CST高频仿真的网格技术

    2024-07-18 05:10:03       35 阅读
  9. 泰勒展开的推导及应用

    2024-07-18 05:10:03       22 阅读