• WebSSH之录屏安全审计(三)


    第一篇:Gin+Xterm.js实现WebSSH远程Kubernetes Pod(一)

    第二篇:WebSSH远程管理Linux服务器、Web终端窗口自适应(二)

    • 支持用户名密码认证

    • 支持SSH密钥认证

    • 支持Web终端窗口自适应

    • 支持录屏审计

    Asciinema#

    Asciinema是一款开源的终端会话录制工具。

    官网: https://asciinema.org/

    安装Asciinema#

    • CentOS
    yum install asciinema -y

    用法#

    以下内容来自官方文档:https://asciinema.org/docs/usage

    • 通过运行
    rec [filename]
    您可以开始一个新的录制会话。当您退出shell时Ctrl+D或exit完成录制。如果记录的进程不是shell,则记录在进程退出时结束。

    如果filename省略该参数,则(在要求确认后)将生成的 asciicast 上传到 asciinema-server(默认为 asciinema.org),在那里可以观看和共享。

    如果filename给出参数,则生成的记录(称为 asciicast)将保存到本地文件中。稍后可以使用 .asciinema 重播和asciinema play /或上传到 asciinema 服务器asciinema upload

    ASCIINEMA_REC=1添加到记录的进程环境变量中。.bashrcshell 的配置文件 ( , )可以使用它来.zshrc更改提示或在录制 shell 时播放声音。

    可用选项:

    • --stdin- 启用标准输入(键盘)录制(见下文)

    • --append- 附加到现有录音

    • --raw- 保存原始 STDOUT 输出,没有计时信息或其他元数据

    • --overwrite- 如果录音已存在,则覆盖录音

    • -c, --command=- 指定要记录的命令,默认为$SHELL

    • -e, --env=- 要捕获的环境变量列表,默认为SHELL,TERM

    • -t, --title=- 指定asciicast的标题</p> </li> <li class="js_darkmode__68" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__69" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: justify; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">-i, --idle-time-limit=<sec>- 将记录的终端不活动限制为最大<sec>秒数</p> </li> <li class="js_darkmode__70" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__71" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: justify; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">-y, --yes- 对所有提示回答“是”(例如上传确认)</p> </li> <li class="js_darkmode__72" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__73" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: justify; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">-q, --quiet- 保持安静,禁止所有通知/警告(隐含 -y)</p> </li> </ul> <p class="js_darkmode__74" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: justify; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">标准输入记录允许捕获用户在当前记录的 shell 中输入的所有字符。播放器(例如asciinema-player )可以使用它 来显示按下的键。因为它基本上是一个按键记录(范围仅限于单个 shell 实例),所以默认情况下它是禁用的,并且必须通过 --stdin选项显式启用。</p> <h2 id="在终端中播放录制的asciicast"><strong>在终端中播放录制的asciicast</strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#在终端中播放录制的asciicast" class="esa-anchor">#</a></h2> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">play <filename></code></pre> <ul class="list-paddingleft-1 js_darkmode__83" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__84" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__85" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">从本地文件播放</p> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">asciinema play /path/to/asciicast.cast</code></pre> <ul class="list-paddingleft-1 js_darkmode__89" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__90" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__91" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;">从HTTP(S) URL播放</p> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">asciinema play https://asciinema.org/a/22124.cast asciinema play http://example.com/demo.cast</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__95" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <section class="js_darkmode__96" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em;">从 asciicast 页面 URL 播放(需要<link rel="alternate" type="application/x-asciicast" href="/my/ascii.cast">在页面的 HTML 中)</section> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">asciinema play https://asciinema.org/a/22124 asciinema play http://example.com/blog/post.html</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__100" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <section class="js_darkmode__101" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">从标准输入播放</section> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs"><span class="hljs-built_in">cat</span> /path/to/asciicast.cast | asciinema play - ssh user@host <span class="hljs-built_in">cat</span> asciicast.cast | asciinema play -</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__105" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <section class="js_darkmode__106" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">从 IPFS 播放</section> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">asciinema play dweb:/ipfs/QmNe7FsYaHc9SaDEAEXbaagAzNw9cH7YbzN4xV7jV1MCzK/ascii.cast</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__110" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <section class="js_darkmode__111" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">可用选项</section> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">-i, --idle-time-limit=<sec>- 将重播的终端不活动限制为最大<sec>秒数 -s, --speed=<<span class="hljs-built_in">factor</span>>- 播放速度(可以是小数)</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__115" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <section class="js_darkmode__116" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">快捷键</section> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">空格:切换暂停 Ctrl+C: <span class="hljs-built_in">exit</span></code></pre> <p> </p> <h2 id="配置文件"><strong>配置文件</strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#配置文件" class="esa-anchor">#</a></h2> <p class="js_darkmode__125" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">您可以通过在 处创建配置文件来配置 asciinema</p> <section class="js_darkmode__126" data-tool="mdnice编辑器" data-website="https://www.mdnice.com" data-style="font-size: 16px; color: black; padding-right: 10px; padding-left: 10px; line-height: 1.6; letter-spacing: 0px; word-break: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;"> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs"><span class="hljs-variable">$HOME</span>/.config/asciinema/config</code></pre> </section> <p>配置分为 ( [api], [record], [play]) 部分。以下是每个部分的所有可用选项的列表</p> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">[api] ; API服务器的URL,默认值:https://asciinema.org ; 如果你运行自己的 asciinema-server 实例,那么在这里设置它的地址 ; 也可以通过设置环境变量 ASCIINEMA_API_URL 来覆盖此设置 url = https://asciinema.example.com [record] ;要记录的命令,默认值: <span class="hljs-variable">$SHELL</span> <span class="hljs-built_in">command</span> = /bin/bash -l ; 启用 stdin (键盘) 记录, 默认值: no stdin = <span class="hljs-built_in">yes</span> ; 要捕获的环境变量列表,默认值: SHELL,TERM <span class="hljs-built_in">env</span> = SHELL,TERM,USER ; 将记录的终端不活动限制为最多 n 秒,默认值: off idle_time_limit = 2 ; 自动回答所有交互式提示的<span class="hljs-string">"是"</span>,默认值: no <span class="hljs-built_in">yes</span> = <span class="hljs-literal">true</span> ; 安静模式,禁止所有通知/警告,默认值: no quiet = <span class="hljs-literal">true</span> [play] ; 回放速度(可以是小数),默认值: 1 speed = 2 ; 将重播的终端不活动限制到最多 n 秒,默认值: off idle_time_limit = 1</code></pre> <h1 id="asciicast数据格式"><strong data-brushtype="text">Asciicast数据格式</strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#asciicast数据格式" class="esa-anchor">#</a></h1> <h2 id="asciicast-文件格式 (version-1)"><strong data-brushtype="text">asciicast 文件格式 (version 1)</strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#asciicast-文件格式 (version-1)" class="esa-anchor">#</a></h2> <section data-role="outer"> <section> <section> <section data-autoskip="1"> <section data-tools="135编辑器" data-id="113759"> <section> <section> <section> <section> <p class="js_darkmode__145" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v1.md</p> <p class="js_darkmode__146" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">asciicast 文件是 JSON 文件,包含元数据(例如录制的持续时间或标题)以及录制期间打印到终端标准输出的实际内容。</p> <p class="js_darkmode__147" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">asciinema 记录器版本 1.0 至 1.4 使用该格式的版本 1。</p> </section> </section> </section> </section> </section> </section> </section> </section> </section> <p class="js_darkmode__148" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> </p> <p class="js_darkmode__149" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">每个 asciicast 都包含以下属性集:</p> <ul class="list-paddingleft-1 js_darkmode__150" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <li class="js_darkmode__151" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__152" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">version:设置为 1,</p> </li> <li class="js_darkmode__153" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__154" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">width:终端宽度(列数),</p> </li> <li class="js_darkmode__155" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__156" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">height:终端高度(行数),</p> </li> <li class="js_darkmode__157" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__158" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">duration:asciicast 作为浮点数的总持续时间,</p> </li> <li class="js_darkmode__159" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__160" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">command:记录的命令,通过-c选项给出rec,</p> </li> <li class="js_darkmode__161" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__162" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">title:asciicast 的标题,通过-t选项给出rec,</p> </li> <li class="js_darkmode__163" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__164" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">env:对于调试播放问题有用的环境变量图,</p> </li> <li class="js_darkmode__165" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__166" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">stdout: 最重要的部分是 "stdout" 数组。此数组中的每个元素都包含一个浮点数和一个字符串。浮点数标记着从会话开始到当前输出发生时经过的时间(单位:秒),字符串则记录了该时间点的具体输出内容。[5.4321, "foo\rbar\u0007..."]</p> </li> </ul> <p class="js_darkmode__167" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> </p> <p class="js_darkmode__170" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"><strong>Asciicast示例</strong></p> <pre class="language-json highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-json hljs"><span class="hljs-punctuation">{</span> <span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"width"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">80</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"height"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">24</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"duration"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1.515658</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"command"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"/bin/zsh"</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"title"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">""</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"env"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span> <span class="hljs-attr">"TERM"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"xterm-256color"</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"SHELL"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"/bin/zsh"</span> <span class="hljs-punctuation">}</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"stdout"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">[</span> <span class="hljs-punctuation">[</span> <span class="hljs-number">0.248848</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"\u001b[1;31mHello \u001b[32mWorld!\u001b[0m\n"</span> <span class="hljs-punctuation">]</span><span class="hljs-punctuation">,</span> <span class="hljs-punctuation">[</span> <span class="hljs-number">1.001376</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"I am \rThis is on the next line."</span> <span class="hljs-punctuation">]</span> <span class="hljs-punctuation">]</span> <span class="hljs-punctuation">}</span></code></pre> <h2 id="asciicast-文件格式(version-2)"><strong>asciicast 文件格式(version 2)</strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#asciicast-文件格式(version-2)" class="esa-anchor">#</a></h2> <p class="js_darkmode__179" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md</p> <p class="js_darkmode__180" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> </p> <p class="js_darkmode__181" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">asciicast v2 文件是以换行符分隔的 JSON文件,其中:</p> <ul class="list-paddingleft-1 js_darkmode__182" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <li class="js_darkmode__183" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__184" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">第一行包含标头(初始终端大小、时间戳和其他元数据),编码为 JSON 对象,</p> </li> <li class="js_darkmode__185" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__186" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">以下所有行形成一个事件流,每行代表一个单独的事件,编码为 3 元素 JSON 数组。</p> </li> </ul> <p class="js_darkmode__187" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> </p> <section class="js_darkmode__190" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__191" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"><strong>示例</strong></p> </section> <pre class="language-json highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-json hljs"><span class="hljs-punctuation">{</span><span class="hljs-attr">"version"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">2</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"width"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">80</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"height"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">24</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"timestamp"</span><span class="hljs-punctuation">:</span> <span class="hljs-number">1504467315</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"title"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"Demo"</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"env"</span><span class="hljs-punctuation">:</span> <span class="hljs-punctuation">{</span><span class="hljs-attr">"TERM"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"xterm-256color"</span><span class="hljs-punctuation">,</span> <span class="hljs-attr">"SHELL"</span><span class="hljs-punctuation">:</span> <span class="hljs-string">"/bin/zsh"</span><span class="hljs-punctuation">}</span><span class="hljs-punctuation">}</span> <span class="hljs-punctuation">[</span><span class="hljs-number">0.248848</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"o"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"\u001b[1;31mHello \u001b[32mWorld!\u001b[0m\n"</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">[</span><span class="hljs-number">1.001376</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"o"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"That was ok\rThis is better."</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">[</span><span class="hljs-number">1.500000</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"m"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">""</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">[</span><span class="hljs-number">2.143733</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"o"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"Now... "</span><span class="hljs-punctuation">]</span> <span class="hljs-punctuation">[</span><span class="hljs-number">6.541828</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"o"</span><span class="hljs-punctuation">,</span> <span class="hljs-string">"Bye!"</span><span class="hljs-punctuation">]</span></code></pre> <p> </p> <h1 id="在html中使用asciinema-player"><strong data-brushtype="text"><span class="js_darkmode__198" data-style="letter-spacing: normal; background-color: rgb(255, 255, 255);"><strong class="js_darkmode__199" data-brushtype="text" data-style="color: rgb(51, 51, 51); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; font-size: 16px; letter-spacing: 0.578px; text-align: left; text-wrap: wrap;">在HTML中使用asciinema-player</strong></span></strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#在html中使用asciinema-player" class="esa-anchor">#</a></h1> <p class="js_darkmode__201" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">https://github.com/asciinema/asciinema-player</p> <p class="js_darkmode__202" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">在releases page中下载最新的asciinema-player.min.js和asciinema-player.css文件</p> <p class="js_darkmode__203" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">首先,将 和您的录音文件添加asciinema-player.min.js到asciinema-player.css您.cast网站的资产中。下面的 HTML 代码段假设它们位于 Web 服务器的根目录中。</p> <p class="js_darkmode__204" dir="auto" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">然后将必要的包含添加到您的 HTML 文档中并在空元素内初始化播放器<div></p> <pre class="language-html highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-html hljs language-xml"><span class="hljs-meta"><!DOCTYPE <span class="hljs-keyword">html</span>></span> <span class="hljs-tag"><<span class="hljs-name">html</span>></span> <span class="hljs-tag"><<span class="hljs-name">head</span>></span> ... <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/asciinema-player.css"</span> /></span> ... <span class="hljs-tag"></<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">body</span>></span> ... <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"demo"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span> ... <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/asciinema-player.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="language-javascript"> <span class="hljs-title class_">AsciinemaPlayer</span>.<span class="hljs-title function_">create</span>(<span class="hljs-string">'/demo.cast'</span>, <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'demo'</span>)); </span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"></<span class="hljs-name">body</span>></span> <span class="hljs-tag"></<span class="hljs-name">html</span>></span></code></pre> <p> </p> <h1 id="后端go-ssh支持asciicast  v1"><strong data-brushtype="text"><span class="js_darkmode__209" data-style="letter-spacing: normal; background-color: rgb(255, 255, 255);">后端go-ssh支持asciicast  v1</span></strong><button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#后端go-ssh支持asciicast  v1" class="esa-anchor">#</a></h1> <ul> <li><strong data-brushtype="text">定义AsciiCast结构体</strong></li> </ul> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-keyword">type</span> AsciiCast <span class="hljs-keyword">struct</span> { Version <span class="hljs-type">int</span> <span class="hljs-string">`json:"version"`</span> Width <span class="hljs-type">int</span> <span class="hljs-string">`json:"width"`</span> Height <span class="hljs-type">int</span> <span class="hljs-string">`json:"height"`</span> <span class="hljs-comment">// 可选属性</span> Timestamp <span class="hljs-type">float64</span> <span class="hljs-string">`json:"timestamp"`</span> Duration <span class="hljs-type">float64</span> <span class="hljs-string">`json:"duration"`</span> Command <span class="hljs-type">string</span> <span class="hljs-string">`json:"command"`</span> Title <span class="hljs-type">string</span> <span class="hljs-string">`json:"title"`</span> Env <span class="hljs-keyword">struct</span> { Term <span class="hljs-type">string</span> <span class="hljs-string">`json:"TERM"`</span> Shell <span class="hljs-type">string</span> <span class="hljs-string">`json:"SHELL"`</span> } <span class="hljs-string">`json:"env"`</span> Stdout [][]<span class="hljs-keyword">interface</span>{} <span class="hljs-string">`json:"stdout"`</span> }</code></pre> <ul class="list-paddingleft-1"> <li class="js_darkmode__216" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p>修改WSClient,增加如下属性</p> </li> </ul> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-keyword">type</span> WSClient <span class="hljs-keyword">struct</span> { <span class="hljs-comment">// AsciiCast</span> asciiCast *AsciiCast <span class="hljs-comment">// 会话开始时间</span> startTime time.Time <span class="hljs-comment">// 持续时间</span> duration <span class="hljs-type">float64</span> <span class="hljs-comment">// 上次用户交互时间</span> prevTime <span class="hljs-type">float64</span> }</code></pre> <ul class="list-paddingleft-1 js_darkmode__224" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <li class="js_darkmode__225" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__226" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">Read方法中记录持续时间,上次记录时间(间隔时间)</p> </li> </ul> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(c *WSClient)</span></span> Read(p []<span class="hljs-type">byte</span>) (n <span class="hljs-type">int</span>, err <span class="hljs-type">error</span>) { <span class="hljs-comment">// ...</span> c.duration = time.Since(c.startTime).Seconds() c.prevTime = c.duration <span class="hljs-comment">// ...</span> }</code></pre> <ul class="list-paddingleft-1 js_darkmode__233" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <li class="js_darkmode__234" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__235" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">Write方法中记录持续时间,上次记录时间(间隔时间)、记录stdin、stdout、stder添加到asciiCast.Stdout</p> </li> </ul> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-params">(c *WSClient)</span></span> Write(p []<span class="hljs-type">byte</span>) (n <span class="hljs-type">int</span>, err <span class="hljs-type">error</span>) { <span class="hljs-comment">// ...</span> err = c.ws.WriteMessage(websocket.TextMessage, p) c.duration = time.Since(c.startTime).Seconds() timeDiff := c.duration - c.prevTime <span class="hljs-comment">// 增加间隔时间,</span> timeDiff += <span class="hljs-number">300.0</span> / <span class="hljs-number">1000.0</span> c.asciiCast.Stdout = <span class="hljs-built_in">append</span>(c.asciiCast.Stdout, []<span class="hljs-keyword">interface</span>{}{timeDiff, <span class="hljs-type">string</span>(p)}) <span class="hljs-comment">// ...</span> }</code></pre> <ul class="list-paddingleft-1 js_darkmode__252" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <li class="js_darkmode__253" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;"> <p class="js_darkmode__254" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; white-space: normal; font-size: 16px; text-align: justify; line-height: 1.75em; margin-bottom: 0px;">SSHHandler中记录会话开始时间、会话终止时保存AsciiCast文件</p> </li> </ul> <section class="js_darkmode__255" data-tool="mdnice编辑器" data-website="https://www.mdnice.com" data-style="font-size: 16px; color: black; padding-right: 10px; padding-left: 10px; line-height: 1.6; letter-spacing: 0px; word-break: break-word; text-align: left; font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif;"> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">SSHHandler</span><span class="hljs-params">(wsClient *WSClient, user, password, ip, authType, command <span class="hljs-type">string</span>, port <span class="hljs-type">int</span>)</span></span> { <span class="hljs-comment">// ...</span> wsClient.startTime = time.Now() <span class="hljs-comment">// ...</span> SaveAsciiCast(wsClient) }</code></pre> </section> <ul class="list-paddingleft-1"> <li class="js_darkmode__262" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__263" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__264" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">SaveAsciiCast保存AsciiCast文件</span></p> </li> </ul> <pre class="language-go highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-go hljs"><span class="hljs-function"><span class="hljs-keyword">func</span> <span class="hljs-title">SaveAsciiCast</span><span class="hljs-params">(c *WSClient)</span></span> { c.asciiCast.Duration = c.duration castData, err := json.MarshalIndent(c.asciiCast, <span class="hljs-string">""</span>, <span class="hljs-string">" "</span>) <span class="hljs-keyword">if</span> err != <span class="hljs-literal">nil</span> { log.Fatal(err) } <span class="hljs-keyword">if</span> err := os.WriteFile(fmt.Sprintf(<span class="hljs-string">"./assets/%s.json"</span>, time.Now().Format(<span class="hljs-string">"20060102150405000"</span>)), castData, <span class="hljs-number">0644</span>); err != <span class="hljs-literal">nil</span> { log.Fatal(err) } }</code></pre> <p class="js_darkmode__269" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__270" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">后端项目完整代码:https://gitee.com/Kub</span><span class="js_darkmode__272" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">eSec/webssh/tree/master/go-ssh</span></p> <h1 class="js_darkmode__273" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;" id="vue中使用asciinema-player">Vue中使用asciinema-player<button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#vue中使用asciinema-player" class="esa-anchor">#</a></h1> <p class="js_darkmode__284" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__285" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">更多用法请参考官方文档:https://github.com/asciinema/asciinema-player</span></p> <p class="js_darkmode__286" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__287" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">从https://github.com/asciinema/asciinema-player/releases页面中下载最新的asciinema-player.min.js和asciinema-player.css文件。</span></p> <p class="js_darkmode__288" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__289" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">把asciinema-player.min.js和asciinema-player.css文件放到项目public目录下</span></p> <p class="js_darkmode__290" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__291" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">在public目录下新建asciinema.html</span></p> <pre class="language-html highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-html hljs language-xml"><span class="hljs-meta"><!DOCTYPE <span class="hljs-keyword">html</span>></span> <span class="hljs-tag"><<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>></span> <span class="hljs-tag"><<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>></span> <span class="hljs-tag"><<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"/asciinema-player.css"</span> /></span> <span class="hljs-tag"><<span class="hljs-name">title</span>></span>asciinema-player<span class="hljs-tag"></<span class="hljs-name">title</span>></span> <span class="hljs-tag"></<span class="hljs-name">head</span>></span> <span class="hljs-tag"><<span class="hljs-name">body</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"demo"</span>></span><span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"><<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/asciinema-player.min.js"</span>></span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="language-javascript"> <span class="hljs-title class_">AsciinemaPlayer</span>.<span class="hljs-title function_">create</span>(<span class="hljs-string">'http://127.0.0.1:9191/assets/20230713200759000.json'</span>, <span class="hljs-variable language_">document</span>.<span class="hljs-title function_">getElementById</span>(<span class="hljs-string">'demo'</span>)); </span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"></<span class="hljs-name">body</span>></span> <span class="hljs-tag"></<span class="hljs-name">html</span>></span></code></pre> <p>在src/views/ssh目录下新建log.vue文件</p> <pre class="language-html highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-html hljs language-xml"><span class="hljs-tag"><<span class="hljs-name">template</span>></span> <span class="hljs-tag"><<span class="hljs-name">div</span> <span class="hljs-attr">style</span>=<span class="hljs-string">"height: 800px; width: 100%"</span>></span> <span class="hljs-tag"><<span class="hljs-name">iframe</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"/asciinema.html"</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"100%"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"100%"</span>></span><span class="hljs-tag"></<span class="hljs-name">iframe</span>></span> <span class="hljs-tag"></<span class="hljs-name">div</span>></span> <span class="hljs-tag"></<span class="hljs-name">template</span>></span> <span class="hljs-tag"><<span class="hljs-name">script</span>></span><span class="language-javascript"> <span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> { <span class="hljs-title function_">data</span>(<span class="hljs-params"></span>) { <span class="hljs-keyword">return</span> { } }, <span class="hljs-attr">methods</span>: { } } </span><span class="hljs-tag"></<span class="hljs-name">script</span>></span> <span class="hljs-tag"><<span class="hljs-name">style</span> <span class="hljs-attr">scoped</span>></span><span class="language-css"> <span class="hljs-selector-tag">html</span>, <span class="hljs-selector-tag">body</span> { <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>; } </span><span class="hljs-tag"></<span class="hljs-name">style</span>></span></code></pre> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140242422-1596459941.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532632.png" class="medium-zoom-image"></a></p> <ul class="list-paddingleft-1 js_darkmode__300" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__301" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__302" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__303" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">在src/router/index.js文件中增加路由</span></p> </li> </ul> <pre class="language-html highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-html hljs language-xml">{ path: '/ssh-logs', component: Layout, children: [ { path: 'ssh-logs', name: 'SSH-logs', component: () => import('@/views/ssh/log.vue'), meta: { title: 'SSH-log', icon: 'form' } } ] },</code></pre> <ul class="list-paddingleft-1 js_darkmode__307" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__308" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__309" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__310" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">启动项目</span></p> </li> </ul> <pre class="language-bash highlighter-hljs" highlighted="true"><code class="highlighter-hljs language-bash hljs">npm install npm run dev</code></pre> <ul class="list-paddingleft-1 js_darkmode__314" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__315" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__316" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__317" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">前端全部代码<br></span></p> </li> </ul> <p class="js_darkmode__318" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__319" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">https://gitee.com/KubeSec/webssh/tree/master/webssh</span></p> <h1 id="测试">测试<button class="cnblogs-toc-button" title="显示目录导航" aria-expanded="false"></button><a href="#测试" class="esa-anchor">#</a></h1> <ul class="list-paddingleft-1 js_darkmode__331" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__332" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__333" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__334" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">在go-ssh项目目录下新建目录assets</span></p> </li> <li class="js_darkmode__335" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__336" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__337" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">登录WebSSH连接主机,输入ls、top等指令,输入exit后关闭会话</span></p> </li> </ul> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140326152-214731510.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532579.png" class="medium-zoom-image"></a></p> <p>查看go-ssh项目assets目录下录制的asciicast文件</p> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140336021-622401776.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532697.png" class="medium-zoom-image"></a></p> <ul class="list-paddingleft-1 js_darkmode__340" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__341" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__342" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__343" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">修改前端项目public/asciinema.html</span></p> </li> </ul> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140409547-578358235.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532607.png" class="medium-zoom-image"></a></p> <ul class="list-paddingleft-1 js_darkmode__344" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <li class="js_darkmode__345" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"> <p class="js_darkmode__346" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; text-align: left; letter-spacing: 0.578px; line-height: 1.75em; margin-bottom: 0px; text-wrap: wrap;"><span class="js_darkmode__347" data-style="color: rgb(0, 0, 0); font-family: Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, "PingFang SC", Cambria, Cochin, Georgia, Times, "Times New Roman", serif; letter-spacing: 0.578px; text-align: left; text-wrap: wrap; font-size: 15px;">浏览器访问:http://localhost:9528/#/ssh-logs/ssh-logs 播放录制的视频</span></p> </li> </ul> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140414276-1546342573.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532504.png" class="medium-zoom-image"></a></p> <p><a href="https://img2023.cnblogs.com/blog/1011251/202307/1011251-20230716140420089-915634786.png" data-title="" data-alt="" data-lightbox="roadtrip"><img src="https://1000bd.com/contentImg/2023/09/05/202532734.png" class="medium-zoom-image"></a></p> <p> </p> </div> </div> </li> <li class="list-group-item ul-li"> <b>相关阅读:</b><br> <nobr> <a href="/Article/Index/1194733">JMeter入门教程(10) --函数助手</a> <br /> <a href="/Article/Index/760757">Spring Boot 2.x系列【22】应用监控篇之Health端点</a> <br /> <a href="/Article/Index/1592364">配置跨域CorsConfig类</a> <br /> <a href="/Article/Index/1340152">Java基于SSM的校园一卡通系统设计与实现</a> <br /> <a href="/Article/Index/1150180">python中urllib库的使用</a> <br /> <a href="/Article/Index/1238216">我用WebGL打造了一款动态壁纸</a> <br /> <a href="/Article/Index/633135">基于Struts2+Hibernate开发学生信息管理系统(选课)</a> <br /> <a href="/Article/Index/1473164">jenkins传参给robotframework</a> <br /> <a href="/Article/Index/853004">husky + lint-staged + commitizen 配置提交代码规范</a> <br /> <a href="/Article/Index/1321393">Husky - 你一定需要的Git Hook 工具</a> <br /> </nobr> </li> <li class="list-group-item from-a mb-2"> 原文地址:https://www.cnblogs.com/0x00000/p/17557809.html </li> </ul> </div> <div class="col-lg-4 col-sm-12"> <ul class="list-group" style="word-break:break-all;"> <li class="list-group-item ul-li-bg" aria-current="true"> 最新文章 </li> <li class="list-group-item ul-li"> <nobr> <a href="/Article/Index/1484446">攻防演习之三天拿下官网站群</a> <br /> <a href="/Article/Index/1515268">数据安全治理学习——前期安全规划和安全管理体系建设</a> <br /> <a href="/Article/Index/1759065">企业安全 | 企业内一次钓鱼演练准备过程</a> <br /> <a href="/Article/Index/1485036">内网渗透测试 | Kerberos协议及其部分攻击手法</a> <br /> <a href="/Article/Index/1877332">0day的产生 | 不懂代码的"代码审计"</a> <br /> <a href="/Article/Index/1887576">安装scrcpy-client模块av模块异常,环境问题解决方案</a> <br /> <a href="/Article/Index/1887578">leetcode hot100【LeetCode 279. 完全平方数】java实现</a> <br /> <a href="/Article/Index/1887512">OpenWrt下安装Mosquitto</a> <br /> <a href="/Article/Index/1887520">AnatoMask论文汇总</a> <br /> <a href="/Article/Index/1887496">【AI日记】24.11.01 LangChain、openai api和github copilot</a> <br /> </nobr> </li> </ul> <ul class="list-group pt-2" style="word-break:break-all;"> <li class="list-group-item ul-li-bg" aria-current="true"> 热门文章 </li> <li class="list-group-item ul-li"> <nobr> <a href="/Article/Index/888177">十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!</a> <br /> <a href="/Article/Index/797680">奉劝各位学弟学妹们,该打造你的技术影响力了!</a> <br /> <a href="/Article/Index/888183">五年了,我在 CSDN 的两个一百万。</a> <br /> <a href="/Article/Index/888179">Java俄罗斯方块,老程序员花了一个周末,连接中学年代!</a> <br /> <a href="/Article/Index/797730">面试官都震惊,你这网络基础可以啊!</a> <br /> <a href="/Article/Index/797725">你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法</a> <br /> <a href="/Article/Index/797702">心情不好的时候,用 Python 画棵樱花树送给自己吧</a> <br /> <a href="/Article/Index/797709">通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!</a> <br /> <a href="/Article/Index/797716">13 万字 C 语言从入门到精通保姆级教程2021 年版</a> <br /> <a href="/Article/Index/888192">10行代码集2000张美女图,Python爬虫120例,再上征途</a> <br /> </nobr> </li> </ul> </div> </div> </div> <!-- 主体 --> <!--body结束--> <!--这里是footer模板--> <!--footer--> <nav class="navbar navbar-inverse navbar-fixed-bottom"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="text-muted center foot-height"> Copyright © 2022 侵权请联系<a href="mailto:2656653265@qq.com">2656653265@qq.com</a>    <a href="https://beian.miit.gov.cn/" target="_blank">京ICP备2022015340号-1</a> </div> <div style="width:300px;margin:0 auto; padding:0px 5px;"> <a href="/regex.html">正则表达式工具</a> <a href="/cron.html">cron表达式工具</a> <a href="/pwdcreator.html">密码生成工具</a> </div> <div style="width:300px;margin:0 auto; padding:5px 0;"> <a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010502049817" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"> <img src="" style="float:left;" /><p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">京公网安备 11010502049817号</p></a> </div> </div> </div> </div> </nav> <!--footer--> <!--footer模板结束--> <script src="/js/plugins/jquery/jquery.js"></script> <script src="/js/bootstrap.min.js"></script> <!--这里是scripts模板--> <!--scripts模板结束--> </body> </html>