东方不败 发表于 2026-8-25 22:30:50

Linux服务器的必修课 SSH 改密钥登录 + 修改端口 + 关闭密码登录

<div class="ce-block ce-block--focused" data-id="PZOGPUNUm-" >
    <div class="ce-block__content">
      <blockquote class="cdx-block cdx-quote">
            <div class="cdx-input cdx-quote__text">
               
            </div>
            <div class="cdx-input cdx-quote__caption cdx-quote__caption-left">
               
            </div>
            <div class="quote-background-icon">
                <svg t="1747277238703" class="icon" viewBox="0 0 1126 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6647" width="60" height="60"><path d="M809.07988966 473.917355c33.85124 8.46280999 50.77686 25.38843 50.77685999 50.77686 0 42.31404999-42.31405 126.942149-135.404959 262.347107-33.85124 50.77686-50.77686 93.090909-50.77686 135.404959 0 67.70247899 25.38843 101.553719 84.6281 101.553719 33.85124001 0 67.702479-25.38843 110.016529-76.165289 169.256198-211.570248 253.884298-406.214876 253.88429699-600.859504 0-93.090909-25.38843-177.719008-76.16528899-236.95867799-50.77686-67.702479-118.479339-93.090909-194.64462799-93.09090901-59.23966901 0-118.479339 25.38843-160.79338901 67.702479S622.89807165 186.18181799 622.89807164 253.884298c8.46281 110.016529 67.702479 186.18181801 186.18181802 220.033057m-609.32231401 0c33.85124 8.46280999 50.77686 25.38843 50.77686 50.77686 0 42.31404999-42.31405 126.942149-135.404959 262.347107-33.85124 50.77686-50.77686 93.090909-50.77686 135.404959 0 67.70247899 25.38843 101.553719 84.6281 101.553719 33.85124001 0 67.702479-25.38843 110.016529-76.165289 169.256198-211.570248 253.884298-414.677686 253.88429701-600.859504 0-93.090909-25.38843-177.719008-76.16528901-236.958678-50.77686-67.702479-118.479339-93.090909-194.644628-93.090909-59.23966901 0-118.479339 25.38843-160.793389 67.702479s-67.70247899 101.553719-67.702479 169.256199c16.92562 110.016529 76.165289 186.181818 186.181818 220.033057" fill="#bfbfbf" p-id="6648"></path></svg>
            </div>
      </blockquote>
    </div>
</div><div class="ce-block ce-block--focused" data-id="R75SQM9QP5" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">注意:操作过程中一定不要关闭当前 SSH 窗口。(没搞好你就得去云厂商VNC救援了<span>&nbsp;</span>悲剧<span>&nbsp;</span>)一定要先确认密钥和新端口能正常登录,再关闭旧端口或退出当前连接。</div>
        </div>
</div><div class="ce-block" data-id="9H6V2kR40L" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">一、准备工作</h2>
        </div>
</div><div class="ce-block ce-block--focused" data-id="CwidCP2q7r" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">假设本文示例:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="nWaV6elfVd" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left"><code><code class="inline-code">服务器用户:root
服务器 IP:1.2.3.4
新 SSH 端口:22222</code>
</code></div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="QXqDqBbV5t" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">你需要把<span></span><code class="inline-code"><span>&nbsp;</span><code>1.2.3.4</code><span>&nbsp;</span></code><span></span>和<span>&nbsp;</span><code><code class="inline-code">22222</code></code><span>&nbsp;</span>改成自己的。</div>
        </div>
</div><div class="ce-block" data-id="tCV4Io1aCZ" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">二、本地生成 SSH 密钥</h2>
        </div>
</div><div class="ce-block ce-block--focused" data-id="xEHKtT5U0a" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">在自己电脑上执行。</div>
        </div>
</div><div class="ce-block" data-id="jorMEAktAx" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Windows PowerShell / Linux / macOS 都可以用</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="81-nbs40An" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-81-nbs40An">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-81-nbs40An">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-81-nbs40An" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-81-nbs40An">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710bwzSU = document.getElementById('codeflask-81-nbs40An');
                        var isCollapsed1796545710bwzSU = true;
                        const flask1796545710bwzSU = new CodeFlask(editorElem1796545710bwzSU, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710bwzSU = `ssh-keygen -t ed25519 -f ~/.ssh/server1_ed25519 -C &quot;server1-key&quot;`;
                            code1796545710bwzSU = code1796545710bwzSU.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710bwzSU.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710bwzSU.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710bwzSU.updateCode(code1796545710bwzSU);

                        const currentCode1796545710bwzSU = flask1796545710bwzSU.getCode();

                            var coderow1796545710bwzSU = parseInt('0');
                          if (coderow1796545710bwzSU === undefined || coderow1796545710bwzSU !== coderow1796545710bwzSU || coderow1796545710bwzSU === 0) {
                                  coderow1796545710bwzSU = flask1796545710bwzSU.lineNumber;
                          }

                            if (coderow1796545710bwzSU < 10) {
                              editorElem1796545710bwzSU.parentElement.style.height = '100px';
                                editorElem1796545710bwzSU.style.height = '100px';
                            } else if (coderow1796545710bwzSU >= 10 && coderow1796545710bwzSU < 20) {
                              editorElem1796545710bwzSU.parentElement.style.height = '300px';
                                editorElem1796545710bwzSU.style.height = '300px';
                            } else if (coderow1796545710bwzSU >= 20) {
                              editorElem1796545710bwzSU.parentElement.style.height = '500px';
                              editorElem1796545710bwzSU.style.height = '500px';
                            }

                        //console.log({currentCode1796545710bwzSU})

                        const copyBtn1796545710bwzSU = document.getElementById('codeflask-copy-81-nbs40An');
                        copyBtn1796545710bwzSU.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710bwzSU).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710bwzSU.innerHTML;
                                      copyBtn1796545710bwzSU.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710bwzSU.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710bwzSU);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710bwzSU);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710bwzSU.innerHTML;
                                      copyBtn1796545710bwzSU.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710bwzSU.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710bwzSU = document.getElementById('codeflask-bottomBtn-81-nbs40An');
                        const Toggle1796545710bwzSU = document.getElementById('codeflask-Toggle-81-nbs40An');
                        bottomBtn1796545710bwzSU.addEventListener('click', function() {
                                if (isCollapsed1796545710bwzSU) {
                                    // 展开代码
                                    isCollapsed1796545710bwzSU = false;
                                  const codeElement1796545710bwzSU = editorElem1796545710bwzSU.querySelector('.codeflask__code');
                                    if (codeElement1796545710bwzSU) {
                                            const actualHeight1796545710bwzSU = codeElement1796545710bwzSU.scrollHeight + 20;

                                            editorElem1796545710bwzSU.parentElement.style.height = actualHeight1796545710bwzSU + 'px';
                                            editorElem1796545710bwzSU.style.height = actualHeight1796545710bwzSU + 'px';
                                    }
                                    bottomBtn1796545710bwzSU.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710bwzSU.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710bwzSU = true;
                                  if (coderow1796545710bwzSU < 20) {
                                      editorElem1796545710bwzSU.parentElement.style.height = '300px';
                                        editorElem1796545710bwzSU.style.height = '300px';
                                    } else if (coderow1796545710bwzSU >= 20) {
                                      editorElem1796545710bwzSU.parentElement.style.height = '500px';
                                      editorElem1796545710bwzSU.style.height = '500px';
                                    }
                                    bottomBtn1796545710bwzSU.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710bwzSU.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710bwzSU.addEventListener('click', function() {
                                bottomBtn1796545710bwzSU.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="FwtcBLIG5t" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">如果是 Windows PowerShell,也可以用:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="pkN1hm3r3J" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-pkN1hm3r3J">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-pkN1hm3r3J">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-pkN1hm3r3J" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-pkN1hm3r3J">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710BVIPz = document.getElementById('codeflask-pkN1hm3r3J');
                        var isCollapsed1796545710BVIPz = true;
                        const flask1796545710BVIPz = new CodeFlask(editorElem1796545710BVIPz, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710BVIPz = `ssh-keygen -t ed25519 -f $env:USERPROFILE\.ssh\server1_ed25519 -C &quot;server1-key&quot;`;
                            code1796545710BVIPz = code1796545710BVIPz.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710BVIPz.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710BVIPz.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710BVIPz.updateCode(code1796545710BVIPz);

                        const currentCode1796545710BVIPz = flask1796545710BVIPz.getCode();

                            var coderow1796545710BVIPz = parseInt('0');
                          if (coderow1796545710BVIPz === undefined || coderow1796545710BVIPz !== coderow1796545710BVIPz || coderow1796545710BVIPz === 0) {
                                  coderow1796545710BVIPz = flask1796545710BVIPz.lineNumber;
                          }

                            if (coderow1796545710BVIPz < 10) {
                              editorElem1796545710BVIPz.parentElement.style.height = '100px';
                                editorElem1796545710BVIPz.style.height = '100px';
                            } else if (coderow1796545710BVIPz >= 10 && coderow1796545710BVIPz < 20) {
                              editorElem1796545710BVIPz.parentElement.style.height = '300px';
                                editorElem1796545710BVIPz.style.height = '300px';
                            } else if (coderow1796545710BVIPz >= 20) {
                              editorElem1796545710BVIPz.parentElement.style.height = '500px';
                              editorElem1796545710BVIPz.style.height = '500px';
                            }

                        //console.log({currentCode1796545710BVIPz})

                        const copyBtn1796545710BVIPz = document.getElementById('codeflask-copy-pkN1hm3r3J');
                        copyBtn1796545710BVIPz.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710BVIPz).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710BVIPz.innerHTML;
                                      copyBtn1796545710BVIPz.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710BVIPz.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710BVIPz);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710BVIPz);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710BVIPz.innerHTML;
                                      copyBtn1796545710BVIPz.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710BVIPz.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710BVIPz = document.getElementById('codeflask-bottomBtn-pkN1hm3r3J');
                        const Toggle1796545710BVIPz = document.getElementById('codeflask-Toggle-pkN1hm3r3J');
                        bottomBtn1796545710BVIPz.addEventListener('click', function() {
                                if (isCollapsed1796545710BVIPz) {
                                    // 展开代码
                                    isCollapsed1796545710BVIPz = false;
                                  const codeElement1796545710BVIPz = editorElem1796545710BVIPz.querySelector('.codeflask__code');
                                    if (codeElement1796545710BVIPz) {
                                            const actualHeight1796545710BVIPz = codeElement1796545710BVIPz.scrollHeight + 20;

                                            editorElem1796545710BVIPz.parentElement.style.height = actualHeight1796545710BVIPz + 'px';
                                            editorElem1796545710BVIPz.style.height = actualHeight1796545710BVIPz + 'px';
                                    }
                                    bottomBtn1796545710BVIPz.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710BVIPz.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710BVIPz = true;
                                  if (coderow1796545710BVIPz < 20) {
                                      editorElem1796545710BVIPz.parentElement.style.height = '300px';
                                        editorElem1796545710BVIPz.style.height = '300px';
                                    } else if (coderow1796545710BVIPz >= 20) {
                                      editorElem1796545710BVIPz.parentElement.style.height = '500px';
                                      editorElem1796545710BVIPz.style.height = '500px';
                                    }
                                    bottomBtn1796545710BVIPz.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710BVIPz.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710BVIPz.addEventListener('click', function() {
                                bottomBtn1796545710BVIPz.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="C8thdEpJzN" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">一路回车即可。</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="4DTWdpoFdy" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">生成后会得到两个文件:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="pc92a7Q_yx" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left"><code>server1_ed25519      私钥,自己保存,不能泄露
server1_ed25519.pub公钥,放到服务器
</code></div>
        </div>
</div><div class="ce-block" data-id="-gspFquiHU" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">三、上传公钥到服务器</h2>
        </div>
</div><div class="ce-block" data-id="7abDvK3SsU" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Windows PowerShell</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="IAquwySH9D" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">把<span>&nbsp;</span><code>1.2.3.4</code><span>&nbsp;</span>改成你的服务器 IP:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="6JoWcjJrYM" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-6JoWcjJrYM">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-6JoWcjJrYM">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-6JoWcjJrYM" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-6JoWcjJrYM">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710Vtlm5 = document.getElementById('codeflask-6JoWcjJrYM');
                        var isCollapsed1796545710Vtlm5 = true;
                        const flask1796545710Vtlm5 = new CodeFlask(editorElem1796545710Vtlm5, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710Vtlm5 = `Get-Content &quot;$env:USERPROFILE\.ssh\server1_ed25519.pub&quot; | ssh root@1.2.3.4 &quot;mkdir -p ~/.ssh &amp;&amp; cat &gt;&gt; ~/.ssh/authorized_keys &amp;&amp; chmod 700 ~/.ssh &amp;&amp; chmod 600 ~/.ssh/authorized_keys&quot;`;
                            code1796545710Vtlm5 = code1796545710Vtlm5.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710Vtlm5.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710Vtlm5.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710Vtlm5.updateCode(code1796545710Vtlm5);

                        const currentCode1796545710Vtlm5 = flask1796545710Vtlm5.getCode();

                            var coderow1796545710Vtlm5 = parseInt('0');
                          if (coderow1796545710Vtlm5 === undefined || coderow1796545710Vtlm5 !== coderow1796545710Vtlm5 || coderow1796545710Vtlm5 === 0) {
                                  coderow1796545710Vtlm5 = flask1796545710Vtlm5.lineNumber;
                          }

                            if (coderow1796545710Vtlm5 < 10) {
                              editorElem1796545710Vtlm5.parentElement.style.height = '100px';
                                editorElem1796545710Vtlm5.style.height = '100px';
                            } else if (coderow1796545710Vtlm5 >= 10 && coderow1796545710Vtlm5 < 20) {
                              editorElem1796545710Vtlm5.parentElement.style.height = '300px';
                                editorElem1796545710Vtlm5.style.height = '300px';
                            } else if (coderow1796545710Vtlm5 >= 20) {
                              editorElem1796545710Vtlm5.parentElement.style.height = '500px';
                              editorElem1796545710Vtlm5.style.height = '500px';
                            }

                        //console.log({currentCode1796545710Vtlm5})

                        const copyBtn1796545710Vtlm5 = document.getElementById('codeflask-copy-6JoWcjJrYM');
                        copyBtn1796545710Vtlm5.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710Vtlm5).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710Vtlm5.innerHTML;
                                      copyBtn1796545710Vtlm5.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710Vtlm5.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710Vtlm5);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710Vtlm5);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710Vtlm5.innerHTML;
                                      copyBtn1796545710Vtlm5.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710Vtlm5.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710Vtlm5 = document.getElementById('codeflask-bottomBtn-6JoWcjJrYM');
                        const Toggle1796545710Vtlm5 = document.getElementById('codeflask-Toggle-6JoWcjJrYM');
                        bottomBtn1796545710Vtlm5.addEventListener('click', function() {
                                if (isCollapsed1796545710Vtlm5) {
                                    // 展开代码
                                    isCollapsed1796545710Vtlm5 = false;
                                  const codeElement1796545710Vtlm5 = editorElem1796545710Vtlm5.querySelector('.codeflask__code');
                                    if (codeElement1796545710Vtlm5) {
                                            const actualHeight1796545710Vtlm5 = codeElement1796545710Vtlm5.scrollHeight + 20;

                                            editorElem1796545710Vtlm5.parentElement.style.height = actualHeight1796545710Vtlm5 + 'px';
                                            editorElem1796545710Vtlm5.style.height = actualHeight1796545710Vtlm5 + 'px';
                                    }
                                    bottomBtn1796545710Vtlm5.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710Vtlm5.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710Vtlm5 = true;
                                  if (coderow1796545710Vtlm5 < 20) {
                                      editorElem1796545710Vtlm5.parentElement.style.height = '300px';
                                        editorElem1796545710Vtlm5.style.height = '300px';
                                    } else if (coderow1796545710Vtlm5 >= 20) {
                                      editorElem1796545710Vtlm5.parentElement.style.height = '500px';
                                      editorElem1796545710Vtlm5.style.height = '500px';
                                    }
                                    bottomBtn1796545710Vtlm5.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710Vtlm5.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710Vtlm5.addEventListener('click', function() {
                                bottomBtn1796545710Vtlm5.click();
                        });
</script><div class="ce-block" data-id="qnBXJyv6yv" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Linux / macOS</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="kgGfRsEbhL" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-kgGfRsEbhL">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-kgGfRsEbhL">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-kgGfRsEbhL" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-kgGfRsEbhL">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710t9l3G = document.getElementById('codeflask-kgGfRsEbhL');
                        var isCollapsed1796545710t9l3G = true;
                        const flask1796545710t9l3G = new CodeFlask(editorElem1796545710t9l3G, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710t9l3G = `ssh-copy-id -i ~/.ssh/server1_ed25519.pub root@1.2.3.4`;
                            code1796545710t9l3G = code1796545710t9l3G.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710t9l3G.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710t9l3G.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710t9l3G.updateCode(code1796545710t9l3G);

                        const currentCode1796545710t9l3G = flask1796545710t9l3G.getCode();

                            var coderow1796545710t9l3G = parseInt('0');
                          if (coderow1796545710t9l3G === undefined || coderow1796545710t9l3G !== coderow1796545710t9l3G || coderow1796545710t9l3G === 0) {
                                  coderow1796545710t9l3G = flask1796545710t9l3G.lineNumber;
                          }

                            if (coderow1796545710t9l3G < 10) {
                              editorElem1796545710t9l3G.parentElement.style.height = '100px';
                                editorElem1796545710t9l3G.style.height = '100px';
                            } else if (coderow1796545710t9l3G >= 10 && coderow1796545710t9l3G < 20) {
                              editorElem1796545710t9l3G.parentElement.style.height = '300px';
                                editorElem1796545710t9l3G.style.height = '300px';
                            } else if (coderow1796545710t9l3G >= 20) {
                              editorElem1796545710t9l3G.parentElement.style.height = '500px';
                              editorElem1796545710t9l3G.style.height = '500px';
                            }

                        //console.log({currentCode1796545710t9l3G})

                        const copyBtn1796545710t9l3G = document.getElementById('codeflask-copy-kgGfRsEbhL');
                        copyBtn1796545710t9l3G.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710t9l3G).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710t9l3G.innerHTML;
                                      copyBtn1796545710t9l3G.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710t9l3G.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710t9l3G);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710t9l3G);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710t9l3G.innerHTML;
                                      copyBtn1796545710t9l3G.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710t9l3G.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710t9l3G = document.getElementById('codeflask-bottomBtn-kgGfRsEbhL');
                        const Toggle1796545710t9l3G = document.getElementById('codeflask-Toggle-kgGfRsEbhL');
                        bottomBtn1796545710t9l3G.addEventListener('click', function() {
                                if (isCollapsed1796545710t9l3G) {
                                    // 展开代码
                                    isCollapsed1796545710t9l3G = false;
                                  const codeElement1796545710t9l3G = editorElem1796545710t9l3G.querySelector('.codeflask__code');
                                    if (codeElement1796545710t9l3G) {
                                            const actualHeight1796545710t9l3G = codeElement1796545710t9l3G.scrollHeight + 20;

                                            editorElem1796545710t9l3G.parentElement.style.height = actualHeight1796545710t9l3G + 'px';
                                            editorElem1796545710t9l3G.style.height = actualHeight1796545710t9l3G + 'px';
                                    }
                                    bottomBtn1796545710t9l3G.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710t9l3G.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710t9l3G = true;
                                  if (coderow1796545710t9l3G < 20) {
                                      editorElem1796545710t9l3G.parentElement.style.height = '300px';
                                        editorElem1796545710t9l3G.style.height = '300px';
                                    } else if (coderow1796545710t9l3G >= 20) {
                                      editorElem1796545710t9l3G.parentElement.style.height = '500px';
                                      editorElem1796545710t9l3G.style.height = '500px';
                                    }
                                    bottomBtn1796545710t9l3G.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710t9l3G.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710t9l3G.addEventListener('click', function() {
                                bottomBtn1796545710t9l3G.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="okKOdbe76T" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">如果你的系统没有<span>&nbsp;</span><code>ssh-copy-id</code>,也可以用:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="F4fy54wbcZ" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-F4fy54wbcZ">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-F4fy54wbcZ">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-F4fy54wbcZ" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-F4fy54wbcZ">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710Oow3I = document.getElementById('codeflask-F4fy54wbcZ');
                        var isCollapsed1796545710Oow3I = true;
                        const flask1796545710Oow3I = new CodeFlask(editorElem1796545710Oow3I, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710Oow3I = `cat ~/.ssh/server1_ed25519.pub | ssh root@1.2.3.4 &quot;mkdir -p ~/.ssh &amp;&amp; cat &gt;&gt; ~/.ssh/authorized_keys &amp;&amp; chmod 700 ~/.ssh &amp;&amp; chmod 600 ~/.ssh/authorized_keys&quot;`;
                            code1796545710Oow3I = code1796545710Oow3I.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710Oow3I.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710Oow3I.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710Oow3I.updateCode(code1796545710Oow3I);

                        const currentCode1796545710Oow3I = flask1796545710Oow3I.getCode();

                            var coderow1796545710Oow3I = parseInt('0');
                          if (coderow1796545710Oow3I === undefined || coderow1796545710Oow3I !== coderow1796545710Oow3I || coderow1796545710Oow3I === 0) {
                                  coderow1796545710Oow3I = flask1796545710Oow3I.lineNumber;
                          }

                            if (coderow1796545710Oow3I < 10) {
                              editorElem1796545710Oow3I.parentElement.style.height = '100px';
                                editorElem1796545710Oow3I.style.height = '100px';
                            } else if (coderow1796545710Oow3I >= 10 && coderow1796545710Oow3I < 20) {
                              editorElem1796545710Oow3I.parentElement.style.height = '300px';
                                editorElem1796545710Oow3I.style.height = '300px';
                            } else if (coderow1796545710Oow3I >= 20) {
                              editorElem1796545710Oow3I.parentElement.style.height = '500px';
                              editorElem1796545710Oow3I.style.height = '500px';
                            }

                        //console.log({currentCode1796545710Oow3I})

                        const copyBtn1796545710Oow3I = document.getElementById('codeflask-copy-F4fy54wbcZ');
                        copyBtn1796545710Oow3I.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710Oow3I).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710Oow3I.innerHTML;
                                      copyBtn1796545710Oow3I.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710Oow3I.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710Oow3I);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710Oow3I);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710Oow3I.innerHTML;
                                      copyBtn1796545710Oow3I.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710Oow3I.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710Oow3I = document.getElementById('codeflask-bottomBtn-F4fy54wbcZ');
                        const Toggle1796545710Oow3I = document.getElementById('codeflask-Toggle-F4fy54wbcZ');
                        bottomBtn1796545710Oow3I.addEventListener('click', function() {
                                if (isCollapsed1796545710Oow3I) {
                                    // 展开代码
                                    isCollapsed1796545710Oow3I = false;
                                  const codeElement1796545710Oow3I = editorElem1796545710Oow3I.querySelector('.codeflask__code');
                                    if (codeElement1796545710Oow3I) {
                                            const actualHeight1796545710Oow3I = codeElement1796545710Oow3I.scrollHeight + 20;

                                            editorElem1796545710Oow3I.parentElement.style.height = actualHeight1796545710Oow3I + 'px';
                                            editorElem1796545710Oow3I.style.height = actualHeight1796545710Oow3I + 'px';
                                    }
                                    bottomBtn1796545710Oow3I.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710Oow3I.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710Oow3I = true;
                                  if (coderow1796545710Oow3I < 20) {
                                      editorElem1796545710Oow3I.parentElement.style.height = '300px';
                                        editorElem1796545710Oow3I.style.height = '300px';
                                    } else if (coderow1796545710Oow3I >= 20) {
                                      editorElem1796545710Oow3I.parentElement.style.height = '500px';
                                      editorElem1796545710Oow3I.style.height = '500px';
                                    }
                                    bottomBtn1796545710Oow3I.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710Oow3I.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710Oow3I.addEventListener('click', function() {
                                bottomBtn1796545710Oow3I.click();
                        });
</script><div class="ce-block" data-id="tXjgimaesu" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">四、测试密钥登录</h2>
        </div>
</div><div class="ce-block" data-id="fRmKFHwY-K" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Windows PowerShell</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="lfNe2ICb_8" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-lfNe2ICb_8">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-lfNe2ICb_8">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-lfNe2ICb_8" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-lfNe2ICb_8">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710k0Btq = document.getElementById('codeflask-lfNe2ICb_8');
                        var isCollapsed1796545710k0Btq = true;
                        const flask1796545710k0Btq = new CodeFlask(editorElem1796545710k0Btq, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710k0Btq = `ssh -i &quot;$env:USERPROFILE\.ssh\server1_ed25519&quot; root@1.2.3.4`;
                            code1796545710k0Btq = code1796545710k0Btq.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710k0Btq.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710k0Btq.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710k0Btq.updateCode(code1796545710k0Btq);

                        const currentCode1796545710k0Btq = flask1796545710k0Btq.getCode();

                            var coderow1796545710k0Btq = parseInt('0');
                          if (coderow1796545710k0Btq === undefined || coderow1796545710k0Btq !== coderow1796545710k0Btq || coderow1796545710k0Btq === 0) {
                                  coderow1796545710k0Btq = flask1796545710k0Btq.lineNumber;
                          }

                            if (coderow1796545710k0Btq < 10) {
                              editorElem1796545710k0Btq.parentElement.style.height = '100px';
                                editorElem1796545710k0Btq.style.height = '100px';
                            } else if (coderow1796545710k0Btq >= 10 && coderow1796545710k0Btq < 20) {
                              editorElem1796545710k0Btq.parentElement.style.height = '300px';
                                editorElem1796545710k0Btq.style.height = '300px';
                            } else if (coderow1796545710k0Btq >= 20) {
                              editorElem1796545710k0Btq.parentElement.style.height = '500px';
                              editorElem1796545710k0Btq.style.height = '500px';
                            }

                        //console.log({currentCode1796545710k0Btq})

                        const copyBtn1796545710k0Btq = document.getElementById('codeflask-copy-lfNe2ICb_8');
                        copyBtn1796545710k0Btq.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710k0Btq).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710k0Btq.innerHTML;
                                      copyBtn1796545710k0Btq.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710k0Btq.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710k0Btq);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710k0Btq);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710k0Btq.innerHTML;
                                      copyBtn1796545710k0Btq.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710k0Btq.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710k0Btq = document.getElementById('codeflask-bottomBtn-lfNe2ICb_8');
                        const Toggle1796545710k0Btq = document.getElementById('codeflask-Toggle-lfNe2ICb_8');
                        bottomBtn1796545710k0Btq.addEventListener('click', function() {
                                if (isCollapsed1796545710k0Btq) {
                                    // 展开代码
                                    isCollapsed1796545710k0Btq = false;
                                  const codeElement1796545710k0Btq = editorElem1796545710k0Btq.querySelector('.codeflask__code');
                                    if (codeElement1796545710k0Btq) {
                                            const actualHeight1796545710k0Btq = codeElement1796545710k0Btq.scrollHeight + 20;

                                            editorElem1796545710k0Btq.parentElement.style.height = actualHeight1796545710k0Btq + 'px';
                                            editorElem1796545710k0Btq.style.height = actualHeight1796545710k0Btq + 'px';
                                    }
                                    bottomBtn1796545710k0Btq.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710k0Btq.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710k0Btq = true;
                                  if (coderow1796545710k0Btq < 20) {
                                      editorElem1796545710k0Btq.parentElement.style.height = '300px';
                                        editorElem1796545710k0Btq.style.height = '300px';
                                    } else if (coderow1796545710k0Btq >= 20) {
                                      editorElem1796545710k0Btq.parentElement.style.height = '500px';
                                      editorElem1796545710k0Btq.style.height = '500px';
                                    }
                                    bottomBtn1796545710k0Btq.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710k0Btq.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710k0Btq.addEventListener('click', function() {
                                bottomBtn1796545710k0Btq.click();
                        });
</script><div class="ce-block" data-id="9LjV0-M8dp" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Linux / macOS</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="4MZhl54QB3" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-4MZhl54QB3">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-4MZhl54QB3">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-4MZhl54QB3" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-4MZhl54QB3">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710zCC11 = document.getElementById('codeflask-4MZhl54QB3');
                        var isCollapsed1796545710zCC11 = true;
                        const flask1796545710zCC11 = new CodeFlask(editorElem1796545710zCC11, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710zCC11 = `ssh -i ~/.ssh/server1_ed25519 root@1.2.3.4`;
                            code1796545710zCC11 = code1796545710zCC11.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710zCC11.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710zCC11.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710zCC11.updateCode(code1796545710zCC11);

                        const currentCode1796545710zCC11 = flask1796545710zCC11.getCode();

                            var coderow1796545710zCC11 = parseInt('0');
                          if (coderow1796545710zCC11 === undefined || coderow1796545710zCC11 !== coderow1796545710zCC11 || coderow1796545710zCC11 === 0) {
                                  coderow1796545710zCC11 = flask1796545710zCC11.lineNumber;
                          }

                            if (coderow1796545710zCC11 < 10) {
                              editorElem1796545710zCC11.parentElement.style.height = '100px';
                                editorElem1796545710zCC11.style.height = '100px';
                            } else if (coderow1796545710zCC11 >= 10 && coderow1796545710zCC11 < 20) {
                              editorElem1796545710zCC11.parentElement.style.height = '300px';
                                editorElem1796545710zCC11.style.height = '300px';
                            } else if (coderow1796545710zCC11 >= 20) {
                              editorElem1796545710zCC11.parentElement.style.height = '500px';
                              editorElem1796545710zCC11.style.height = '500px';
                            }

                        //console.log({currentCode1796545710zCC11})

                        const copyBtn1796545710zCC11 = document.getElementById('codeflask-copy-4MZhl54QB3');
                        copyBtn1796545710zCC11.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710zCC11).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710zCC11.innerHTML;
                                      copyBtn1796545710zCC11.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710zCC11.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710zCC11);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710zCC11);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710zCC11.innerHTML;
                                      copyBtn1796545710zCC11.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710zCC11.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710zCC11 = document.getElementById('codeflask-bottomBtn-4MZhl54QB3');
                        const Toggle1796545710zCC11 = document.getElementById('codeflask-Toggle-4MZhl54QB3');
                        bottomBtn1796545710zCC11.addEventListener('click', function() {
                                if (isCollapsed1796545710zCC11) {
                                    // 展开代码
                                    isCollapsed1796545710zCC11 = false;
                                  const codeElement1796545710zCC11 = editorElem1796545710zCC11.querySelector('.codeflask__code');
                                    if (codeElement1796545710zCC11) {
                                            const actualHeight1796545710zCC11 = codeElement1796545710zCC11.scrollHeight + 20;

                                            editorElem1796545710zCC11.parentElement.style.height = actualHeight1796545710zCC11 + 'px';
                                            editorElem1796545710zCC11.style.height = actualHeight1796545710zCC11 + 'px';
                                    }
                                    bottomBtn1796545710zCC11.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710zCC11.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710zCC11 = true;
                                  if (coderow1796545710zCC11 < 20) {
                                      editorElem1796545710zCC11.parentElement.style.height = '300px';
                                        editorElem1796545710zCC11.style.height = '300px';
                                    } else if (coderow1796545710zCC11 >= 20) {
                                      editorElem1796545710zCC11.parentElement.style.height = '500px';
                                      editorElem1796545710zCC11.style.height = '500px';
                                    }
                                    bottomBtn1796545710zCC11.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710zCC11.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710zCC11.addEventListener('click', function() {
                                bottomBtn1796545710zCC11.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="kQUwiMQ_7B" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">如果可以正常登录,说明密钥配置成功。</div>
        </div>
</div><div class="ce-block" data-id="LTg7hWmYcC" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">五、一键修改 SSH 端口并关闭密码登录</h2>
        </div>
</div><div class="ce-block ce-block--focused" data-id="j_2ll02P75" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">用密码先登录到服务器</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="fE0mN-vVwt" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">在服务器上执行下面命令。</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="2q-3Dcxpgj" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">示例端口是<span>&nbsp;</span><code><code class="inline-code">22222</code></code>,可以自行修改:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="VXwehwLU8L" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-VXwehwLU8L">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-VXwehwLU8L">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-VXwehwLU8L" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-VXwehwLU8L">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710cRb2f = document.getElementById('codeflask-VXwehwLU8L');
                        var isCollapsed1796545710cRb2f = true;
                        const flask1796545710cRb2f = new CodeFlask(editorElem1796545710cRb2f, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710cRb2f = `NEW_PORT=22222
mkdir -p /etc/ssh/sshd_config.d
cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)
cat &gt; /etc/ssh/sshd_config.d/99-custom-ssh.conf &lt;&lt;EOF
# 自定义 SSH 端口
Port \${NEW_PORT}
# 开启 SSH 密钥登录
PubkeyAuthentication yes
# 禁止 SSH 密码登录
PasswordAuthentication no
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no
# root 用户只允许密钥登录
PermitRootLogin prohibit-password
EOF
# 如果安装了 UFW,则自动放行新的 SSH 端口
if command -v ufw &gt;/dev/null 2&gt;&amp;1; then
ufw allow \${NEW_PORT}/tcp comment &quot;放行自定义 SSH 端口&quot;
fi
# 检查 SSH 配置并重载 SSH 服务
sshd -t &amp;&amp; systemctl reload ssh || systemctl reload sshd`;
                            code1796545710cRb2f = code1796545710cRb2f.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710cRb2f.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710cRb2f.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710cRb2f.updateCode(code1796545710cRb2f);

                        const currentCode1796545710cRb2f = flask1796545710cRb2f.getCode();

                            var coderow1796545710cRb2f = parseInt('0');
                          if (coderow1796545710cRb2f === undefined || coderow1796545710cRb2f !== coderow1796545710cRb2f || coderow1796545710cRb2f === 0) {
                                  coderow1796545710cRb2f = flask1796545710cRb2f.lineNumber;
                          }

                            if (coderow1796545710cRb2f < 10) {
                              editorElem1796545710cRb2f.parentElement.style.height = '100px';
                                editorElem1796545710cRb2f.style.height = '100px';
                            } else if (coderow1796545710cRb2f >= 10 && coderow1796545710cRb2f < 20) {
                              editorElem1796545710cRb2f.parentElement.style.height = '300px';
                                editorElem1796545710cRb2f.style.height = '300px';
                            } else if (coderow1796545710cRb2f >= 20) {
                              editorElem1796545710cRb2f.parentElement.style.height = '500px';
                              editorElem1796545710cRb2f.style.height = '500px';
                            }

                        //console.log({currentCode1796545710cRb2f})

                        const copyBtn1796545710cRb2f = document.getElementById('codeflask-copy-VXwehwLU8L');
                        copyBtn1796545710cRb2f.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710cRb2f).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710cRb2f.innerHTML;
                                      copyBtn1796545710cRb2f.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710cRb2f.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710cRb2f);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710cRb2f);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710cRb2f.innerHTML;
                                      copyBtn1796545710cRb2f.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710cRb2f.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710cRb2f = document.getElementById('codeflask-bottomBtn-VXwehwLU8L');
                        const Toggle1796545710cRb2f = document.getElementById('codeflask-Toggle-VXwehwLU8L');
                        bottomBtn1796545710cRb2f.addEventListener('click', function() {
                                if (isCollapsed1796545710cRb2f) {
                                    // 展开代码
                                    isCollapsed1796545710cRb2f = false;
                                  const codeElement1796545710cRb2f = editorElem1796545710cRb2f.querySelector('.codeflask__code');
                                    if (codeElement1796545710cRb2f) {
                                            const actualHeight1796545710cRb2f = codeElement1796545710cRb2f.scrollHeight + 20;

                                            editorElem1796545710cRb2f.parentElement.style.height = actualHeight1796545710cRb2f + 'px';
                                            editorElem1796545710cRb2f.style.height = actualHeight1796545710cRb2f + 'px';
                                    }
                                    bottomBtn1796545710cRb2f.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710cRb2f.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710cRb2f = true;
                                  if (coderow1796545710cRb2f < 20) {
                                      editorElem1796545710cRb2f.parentElement.style.height = '300px';
                                        editorElem1796545710cRb2f.style.height = '300px';
                                    } else if (coderow1796545710cRb2f >= 20) {
                                      editorElem1796545710cRb2f.parentElement.style.height = '500px';
                                      editorElem1796545710cRb2f.style.height = '500px';
                                    }
                                    bottomBtn1796545710cRb2f.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710cRb2f.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710cRb2f.addEventListener('click', function() {
                                bottomBtn1796545710cRb2f.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="BsBB_Pfx_3" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-BsBB_Pfx_3">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-BsBB_Pfx_3">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-BsBB_Pfx_3" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-BsBB_Pfx_3">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710Ybb5l = document.getElementById('codeflask-BsBB_Pfx_3');
                        var isCollapsed1796545710Ybb5l = true;
                        const flask1796545710Ybb5l = new CodeFlask(editorElem1796545710Ybb5l, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710Ybb5l = `NEW_PORT=22222

mkdir -p /etc/ssh/sshd_config.d

cp -a /etc/ssh/sshd_config /etc/ssh/sshd_config.bak.$(date +%F-%H%M%S)

cat &gt; /etc/ssh/sshd_config.d/99-custom-ssh.conf &lt;&lt;EOF
# 自定义 SSH 端口
Port \${NEW_PORT}

# 开启 SSH 密钥登录
PubkeyAuthentication yes

# 禁止 SSH 密码登录
PasswordAuthentication no
KbdInteractiveAuthentication no
ChallengeResponseAuthentication no

# root 用户只允许密钥登录
PermitRootLogin prohibit-password
EOF

# 如果安装了 UFW,则自动放行新的 SSH 端口
if command -v ufw &gt;/dev/null 2&gt;&amp;1; then
ufw allow \${NEW_PORT}/tcp comment &quot;放行自定义 SSH 端口&quot;
fi

# 检查 SSH 配置并重载 SSH 服务
sshd -t &amp;&amp; systemctl reload ssh || systemctl reload sshd`;
                            code1796545710Ybb5l = code1796545710Ybb5l.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710Ybb5l.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710Ybb5l.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710Ybb5l.updateCode(code1796545710Ybb5l);

                        const currentCode1796545710Ybb5l = flask1796545710Ybb5l.getCode();

                            var coderow1796545710Ybb5l = parseInt('0');
                          if (coderow1796545710Ybb5l === undefined || coderow1796545710Ybb5l !== coderow1796545710Ybb5l || coderow1796545710Ybb5l === 0) {
                                  coderow1796545710Ybb5l = flask1796545710Ybb5l.lineNumber;
                          }

                            if (coderow1796545710Ybb5l < 10) {
                              editorElem1796545710Ybb5l.parentElement.style.height = '100px';
                                editorElem1796545710Ybb5l.style.height = '100px';
                            } else if (coderow1796545710Ybb5l >= 10 && coderow1796545710Ybb5l < 20) {
                              editorElem1796545710Ybb5l.parentElement.style.height = '300px';
                                editorElem1796545710Ybb5l.style.height = '300px';
                            } else if (coderow1796545710Ybb5l >= 20) {
                              editorElem1796545710Ybb5l.parentElement.style.height = '500px';
                              editorElem1796545710Ybb5l.style.height = '500px';
                            }

                        //console.log({currentCode1796545710Ybb5l})

                        const copyBtn1796545710Ybb5l = document.getElementById('codeflask-copy-BsBB_Pfx_3');
                        copyBtn1796545710Ybb5l.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710Ybb5l).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710Ybb5l.innerHTML;
                                      copyBtn1796545710Ybb5l.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710Ybb5l.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710Ybb5l);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710Ybb5l);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710Ybb5l.innerHTML;
                                      copyBtn1796545710Ybb5l.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710Ybb5l.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710Ybb5l = document.getElementById('codeflask-bottomBtn-BsBB_Pfx_3');
                        const Toggle1796545710Ybb5l = document.getElementById('codeflask-Toggle-BsBB_Pfx_3');
                        bottomBtn1796545710Ybb5l.addEventListener('click', function() {
                                if (isCollapsed1796545710Ybb5l) {
                                    // 展开代码
                                    isCollapsed1796545710Ybb5l = false;
                                  const codeElement1796545710Ybb5l = editorElem1796545710Ybb5l.querySelector('.codeflask__code');
                                    if (codeElement1796545710Ybb5l) {
                                            const actualHeight1796545710Ybb5l = codeElement1796545710Ybb5l.scrollHeight + 20;

                                            editorElem1796545710Ybb5l.parentElement.style.height = actualHeight1796545710Ybb5l + 'px';
                                            editorElem1796545710Ybb5l.style.height = actualHeight1796545710Ybb5l + 'px';
                                    }
                                    bottomBtn1796545710Ybb5l.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710Ybb5l.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710Ybb5l = true;
                                  if (coderow1796545710Ybb5l < 20) {
                                      editorElem1796545710Ybb5l.parentElement.style.height = '300px';
                                        editorElem1796545710Ybb5l.style.height = '300px';
                                    } else if (coderow1796545710Ybb5l >= 20) {
                                      editorElem1796545710Ybb5l.parentElement.style.height = '500px';
                                      editorElem1796545710Ybb5l.style.height = '500px';
                                    }
                                    bottomBtn1796545710Ybb5l.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710Ybb5l.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710Ybb5l.addEventListener('click', function() {
                                bottomBtn1796545710Ybb5l.click();
                        });
</script><div class="ce-block" data-id="lmR3s81OS6" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">六、测试新端口登录</h2>
        </div>
</div><div class="ce-block ce-block--focused" data-id="7_7wyJ3Bsg" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">不要关闭当前 SSH 窗口,新开一个窗口测试。</div>
        </div>
</div><div class="ce-block" data-id="qJxcU_kkgN" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Windows PowerShell</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="j4i0zaNLid" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-j4i0zaNLid">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-j4i0zaNLid">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-j4i0zaNLid" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-j4i0zaNLid">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710x97kr = document.getElementById('codeflask-j4i0zaNLid');
                        var isCollapsed1796545710x97kr = true;
                        const flask1796545710x97kr = new CodeFlask(editorElem1796545710x97kr, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710x97kr = `ssh -i &quot;$env:USERPROFILE\.ssh\server1_ed25519&quot; -p 22222 root@1.2.3.4`;
                            code1796545710x97kr = code1796545710x97kr.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710x97kr.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710x97kr.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710x97kr.updateCode(code1796545710x97kr);

                        const currentCode1796545710x97kr = flask1796545710x97kr.getCode();

                            var coderow1796545710x97kr = parseInt('0');
                          if (coderow1796545710x97kr === undefined || coderow1796545710x97kr !== coderow1796545710x97kr || coderow1796545710x97kr === 0) {
                                  coderow1796545710x97kr = flask1796545710x97kr.lineNumber;
                          }

                            if (coderow1796545710x97kr < 10) {
                              editorElem1796545710x97kr.parentElement.style.height = '100px';
                                editorElem1796545710x97kr.style.height = '100px';
                            } else if (coderow1796545710x97kr >= 10 && coderow1796545710x97kr < 20) {
                              editorElem1796545710x97kr.parentElement.style.height = '300px';
                                editorElem1796545710x97kr.style.height = '300px';
                            } else if (coderow1796545710x97kr >= 20) {
                              editorElem1796545710x97kr.parentElement.style.height = '500px';
                              editorElem1796545710x97kr.style.height = '500px';
                            }

                        //console.log({currentCode1796545710x97kr})

                        const copyBtn1796545710x97kr = document.getElementById('codeflask-copy-j4i0zaNLid');
                        copyBtn1796545710x97kr.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710x97kr).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710x97kr.innerHTML;
                                      copyBtn1796545710x97kr.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710x97kr.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710x97kr);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710x97kr);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710x97kr.innerHTML;
                                      copyBtn1796545710x97kr.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710x97kr.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710x97kr = document.getElementById('codeflask-bottomBtn-j4i0zaNLid');
                        const Toggle1796545710x97kr = document.getElementById('codeflask-Toggle-j4i0zaNLid');
                        bottomBtn1796545710x97kr.addEventListener('click', function() {
                                if (isCollapsed1796545710x97kr) {
                                    // 展开代码
                                    isCollapsed1796545710x97kr = false;
                                  const codeElement1796545710x97kr = editorElem1796545710x97kr.querySelector('.codeflask__code');
                                    if (codeElement1796545710x97kr) {
                                            const actualHeight1796545710x97kr = codeElement1796545710x97kr.scrollHeight + 20;

                                            editorElem1796545710x97kr.parentElement.style.height = actualHeight1796545710x97kr + 'px';
                                            editorElem1796545710x97kr.style.height = actualHeight1796545710x97kr + 'px';
                                    }
                                    bottomBtn1796545710x97kr.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710x97kr.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710x97kr = true;
                                  if (coderow1796545710x97kr < 20) {
                                      editorElem1796545710x97kr.parentElement.style.height = '300px';
                                        editorElem1796545710x97kr.style.height = '300px';
                                    } else if (coderow1796545710x97kr >= 20) {
                                      editorElem1796545710x97kr.parentElement.style.height = '500px';
                                      editorElem1796545710x97kr.style.height = '500px';
                                    }
                                    bottomBtn1796545710x97kr.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710x97kr.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710x97kr.addEventListener('click', function() {
                                bottomBtn1796545710x97kr.click();
                        });
</script><div class="ce-block" data-id="gOB1SN1bpT" >
        <div class="ce-block__content" style="">
                <h3 class="ce-header ce-header--left">Linux / macOS</h3>
        </div>
</div><div class="ce-block ce-block--focused" data-id="OjTQWK-IOh" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-OjTQWK-IOh">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-OjTQWK-IOh">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-OjTQWK-IOh" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-OjTQWK-IOh">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710i6lH3 = document.getElementById('codeflask-OjTQWK-IOh');
                        var isCollapsed1796545710i6lH3 = true;
                        const flask1796545710i6lH3 = new CodeFlask(editorElem1796545710i6lH3, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710i6lH3 = `ssh -i ~/.ssh/server1_ed25519 -p 22222 root@1.2.3.4`;
                            code1796545710i6lH3 = code1796545710i6lH3.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710i6lH3.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710i6lH3.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710i6lH3.updateCode(code1796545710i6lH3);

                        const currentCode1796545710i6lH3 = flask1796545710i6lH3.getCode();

                            var coderow1796545710i6lH3 = parseInt('0');
                          if (coderow1796545710i6lH3 === undefined || coderow1796545710i6lH3 !== coderow1796545710i6lH3 || coderow1796545710i6lH3 === 0) {
                                  coderow1796545710i6lH3 = flask1796545710i6lH3.lineNumber;
                          }

                            if (coderow1796545710i6lH3 < 10) {
                              editorElem1796545710i6lH3.parentElement.style.height = '100px';
                                editorElem1796545710i6lH3.style.height = '100px';
                            } else if (coderow1796545710i6lH3 >= 10 && coderow1796545710i6lH3 < 20) {
                              editorElem1796545710i6lH3.parentElement.style.height = '300px';
                                editorElem1796545710i6lH3.style.height = '300px';
                            } else if (coderow1796545710i6lH3 >= 20) {
                              editorElem1796545710i6lH3.parentElement.style.height = '500px';
                              editorElem1796545710i6lH3.style.height = '500px';
                            }

                        //console.log({currentCode1796545710i6lH3})

                        const copyBtn1796545710i6lH3 = document.getElementById('codeflask-copy-OjTQWK-IOh');
                        copyBtn1796545710i6lH3.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710i6lH3).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710i6lH3.innerHTML;
                                      copyBtn1796545710i6lH3.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710i6lH3.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710i6lH3);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710i6lH3);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710i6lH3.innerHTML;
                                      copyBtn1796545710i6lH3.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710i6lH3.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710i6lH3 = document.getElementById('codeflask-bottomBtn-OjTQWK-IOh');
                        const Toggle1796545710i6lH3 = document.getElementById('codeflask-Toggle-OjTQWK-IOh');
                        bottomBtn1796545710i6lH3.addEventListener('click', function() {
                                if (isCollapsed1796545710i6lH3) {
                                    // 展开代码
                                    isCollapsed1796545710i6lH3 = false;
                                  const codeElement1796545710i6lH3 = editorElem1796545710i6lH3.querySelector('.codeflask__code');
                                    if (codeElement1796545710i6lH3) {
                                            const actualHeight1796545710i6lH3 = codeElement1796545710i6lH3.scrollHeight + 20;

                                            editorElem1796545710i6lH3.parentElement.style.height = actualHeight1796545710i6lH3 + 'px';
                                            editorElem1796545710i6lH3.style.height = actualHeight1796545710i6lH3 + 'px';
                                    }
                                    bottomBtn1796545710i6lH3.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710i6lH3.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710i6lH3 = true;
                                  if (coderow1796545710i6lH3 < 20) {
                                      editorElem1796545710i6lH3.parentElement.style.height = '300px';
                                        editorElem1796545710i6lH3.style.height = '300px';
                                    } else if (coderow1796545710i6lH3 >= 20) {
                                      editorElem1796545710i6lH3.parentElement.style.height = '500px';
                                      editorElem1796545710i6lH3.style.height = '500px';
                                    }
                                    bottomBtn1796545710i6lH3.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710i6lH3.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710i6lH3.addEventListener('click', function() {
                                bottomBtn1796545710i6lH3.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="YPuFbG8TLo" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">如果可以正常登录,说明修改成功。</div>
        </div>
</div><div class="ce-block" data-id="6TxjRhoqYx" >
        <div class="ce-block__content" style="">
                <h2 class="ce-header ce-header--left">七、关闭旧的 22 端口</h2>
        </div>
</div><div class="ce-block ce-block--focused" data-id="SRogPPUMcu" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">确认新端口可以正常登录后,再关闭旧端口。</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="HJr2bLbiBU" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">如果你使用 UFW,可以执行:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="MR2I42v_cb" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-MR2I42v_cb">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-MR2I42v_cb">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-MR2I42v_cb" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-MR2I42v_cb">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710vzT6Q = document.getElementById('codeflask-MR2I42v_cb');
                        var isCollapsed1796545710vzT6Q = true;
                        const flask1796545710vzT6Q = new CodeFlask(editorElem1796545710vzT6Q, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710vzT6Q = `ufw deny 22/tcp comment &quot;阻断 SSH 端口 22&quot;`;
                            code1796545710vzT6Q = code1796545710vzT6Q.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710vzT6Q.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710vzT6Q.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710vzT6Q.updateCode(code1796545710vzT6Q);

                        const currentCode1796545710vzT6Q = flask1796545710vzT6Q.getCode();

                            var coderow1796545710vzT6Q = parseInt('0');
                          if (coderow1796545710vzT6Q === undefined || coderow1796545710vzT6Q !== coderow1796545710vzT6Q || coderow1796545710vzT6Q === 0) {
                                  coderow1796545710vzT6Q = flask1796545710vzT6Q.lineNumber;
                          }

                            if (coderow1796545710vzT6Q < 10) {
                              editorElem1796545710vzT6Q.parentElement.style.height = '100px';
                                editorElem1796545710vzT6Q.style.height = '100px';
                            } else if (coderow1796545710vzT6Q >= 10 && coderow1796545710vzT6Q < 20) {
                              editorElem1796545710vzT6Q.parentElement.style.height = '300px';
                                editorElem1796545710vzT6Q.style.height = '300px';
                            } else if (coderow1796545710vzT6Q >= 20) {
                              editorElem1796545710vzT6Q.parentElement.style.height = '500px';
                              editorElem1796545710vzT6Q.style.height = '500px';
                            }

                        //console.log({currentCode1796545710vzT6Q})

                        const copyBtn1796545710vzT6Q = document.getElementById('codeflask-copy-MR2I42v_cb');
                        copyBtn1796545710vzT6Q.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710vzT6Q).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710vzT6Q.innerHTML;
                                      copyBtn1796545710vzT6Q.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710vzT6Q.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710vzT6Q);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710vzT6Q);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710vzT6Q.innerHTML;
                                      copyBtn1796545710vzT6Q.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710vzT6Q.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710vzT6Q = document.getElementById('codeflask-bottomBtn-MR2I42v_cb');
                        const Toggle1796545710vzT6Q = document.getElementById('codeflask-Toggle-MR2I42v_cb');
                        bottomBtn1796545710vzT6Q.addEventListener('click', function() {
                                if (isCollapsed1796545710vzT6Q) {
                                    // 展开代码
                                    isCollapsed1796545710vzT6Q = false;
                                  const codeElement1796545710vzT6Q = editorElem1796545710vzT6Q.querySelector('.codeflask__code');
                                    if (codeElement1796545710vzT6Q) {
                                            const actualHeight1796545710vzT6Q = codeElement1796545710vzT6Q.scrollHeight + 20;

                                            editorElem1796545710vzT6Q.parentElement.style.height = actualHeight1796545710vzT6Q + 'px';
                                            editorElem1796545710vzT6Q.style.height = actualHeight1796545710vzT6Q + 'px';
                                    }
                                    bottomBtn1796545710vzT6Q.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710vzT6Q.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710vzT6Q = true;
                                  if (coderow1796545710vzT6Q < 20) {
                                      editorElem1796545710vzT6Q.parentElement.style.height = '300px';
                                        editorElem1796545710vzT6Q.style.height = '300px';
                                    } else if (coderow1796545710vzT6Q >= 20) {
                                      editorElem1796545710vzT6Q.parentElement.style.height = '500px';
                                      editorElem1796545710vzT6Q.style.height = '500px';
                                    }
                                    bottomBtn1796545710vzT6Q.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710vzT6Q.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710vzT6Q.addEventListener('click', function() {
                                bottomBtn1796545710vzT6Q.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="imP0YdxWLx" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">或者删除原来的 22 放行规则:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="Hg-vNnSXzE" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-Hg-vNnSXzE">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-Hg-vNnSXzE">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-Hg-vNnSXzE" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-Hg-vNnSXzE">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710nBabn = document.getElementById('codeflask-Hg-vNnSXzE');
                        var isCollapsed1796545710nBabn = true;
                        const flask1796545710nBabn = new CodeFlask(editorElem1796545710nBabn, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710nBabn = `ufw delete allow 22/tcp`;
                            code1796545710nBabn = code1796545710nBabn.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710nBabn.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710nBabn.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710nBabn.updateCode(code1796545710nBabn);

                        const currentCode1796545710nBabn = flask1796545710nBabn.getCode();

                            var coderow1796545710nBabn = parseInt('0');
                          if (coderow1796545710nBabn === undefined || coderow1796545710nBabn !== coderow1796545710nBabn || coderow1796545710nBabn === 0) {
                                  coderow1796545710nBabn = flask1796545710nBabn.lineNumber;
                          }

                            if (coderow1796545710nBabn < 10) {
                              editorElem1796545710nBabn.parentElement.style.height = '100px';
                                editorElem1796545710nBabn.style.height = '100px';
                            } else if (coderow1796545710nBabn >= 10 && coderow1796545710nBabn < 20) {
                              editorElem1796545710nBabn.parentElement.style.height = '300px';
                                editorElem1796545710nBabn.style.height = '300px';
                            } else if (coderow1796545710nBabn >= 20) {
                              editorElem1796545710nBabn.parentElement.style.height = '500px';
                              editorElem1796545710nBabn.style.height = '500px';
                            }

                        //console.log({currentCode1796545710nBabn})

                        const copyBtn1796545710nBabn = document.getElementById('codeflask-copy-Hg-vNnSXzE');
                        copyBtn1796545710nBabn.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710nBabn).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710nBabn.innerHTML;
                                      copyBtn1796545710nBabn.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710nBabn.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710nBabn);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710nBabn);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710nBabn.innerHTML;
                                      copyBtn1796545710nBabn.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710nBabn.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710nBabn = document.getElementById('codeflask-bottomBtn-Hg-vNnSXzE');
                        const Toggle1796545710nBabn = document.getElementById('codeflask-Toggle-Hg-vNnSXzE');
                        bottomBtn1796545710nBabn.addEventListener('click', function() {
                                if (isCollapsed1796545710nBabn) {
                                    // 展开代码
                                    isCollapsed1796545710nBabn = false;
                                  const codeElement1796545710nBabn = editorElem1796545710nBabn.querySelector('.codeflask__code');
                                    if (codeElement1796545710nBabn) {
                                            const actualHeight1796545710nBabn = codeElement1796545710nBabn.scrollHeight + 20;

                                            editorElem1796545710nBabn.parentElement.style.height = actualHeight1796545710nBabn + 'px';
                                            editorElem1796545710nBabn.style.height = actualHeight1796545710nBabn + 'px';
                                    }
                                    bottomBtn1796545710nBabn.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710nBabn.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710nBabn = true;
                                  if (coderow1796545710nBabn < 20) {
                                      editorElem1796545710nBabn.parentElement.style.height = '300px';
                                        editorElem1796545710nBabn.style.height = '300px';
                                    } else if (coderow1796545710nBabn >= 20) {
                                      editorElem1796545710nBabn.parentElement.style.height = '500px';
                                      editorElem1796545710nBabn.style.height = '500px';
                                    }
                                    bottomBtn1796545710nBabn.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710nBabn.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710nBabn.addEventListener('click', function() {
                                bottomBtn1796545710nBabn.click();
                        });
</script><div class="ce-block ce-block--focused" data-id="5niOt8VCzV" >
        <div class="ce-block__content">
                <div class="ce-paragraph cdx-block ce-paragraph--left">查看当前防火墙规则:</div>
        </div>
</div><div class="ce-block ce-block--focused" data-id="FEtIN6dak8" >
    <div class="ce-block__content">
      <div class="editorjs-codeFlask_Wrapper">
                <div class="editorjs-codeFlask_Header">
                        <div class="editorjs-codeFlask_LangDisplay">shell</div>
                        <button class="editorjs-codeFlask_CopyButton" title="复制代码" id="codeflask-copy-FEtIN6dak8">
                                <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                                        <rect x="9" y="9" width="13" height="13" rx="2" ry="2"></rect>
                                        <path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path>
                                </svg>
                        </button>
                        <button class="editorjs-codeFlask_Toggle" id="codeflask-Toggle-FEtIN6dak8">
                              <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                              <polyline points="6 9 12 15 18 9"></polyline>
                              </svg>
                        </button>
                </div>
                <div class="editorjs-codeFlask_ContentContainer">
                        <div class="editorjs-codeFlask_Editor" id="codeflask-FEtIN6dak8" >
                       
                        </div>
                </div>
                <div class="editorjs-codeFlask_BottomButtonContainer" id="codeflask-bottomBtn-FEtIN6dak8">
                        <button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>
                </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="static/js/editorjs/tools/codeflask/codeflask150.min.js?ym2"></script>
<script type="application/javascript">
                        const editorElem1796545710W8V02 = document.getElementById('codeflask-FEtIN6dak8');
                        var isCollapsed1796545710W8V02 = true;
                        const flask1796545710W8V02 = new CodeFlask(editorElem1796545710W8V02, {
                                language: 'shell',
                                lineNumbers: true,
                                styleParent: this.shadowRoot,
                                rtl: false,
                                readonly: true
                        });
                            var code1796545710W8V02 = `ufw status numbered`;
                            code1796545710W8V02 = code1796545710W8V02.replace(/&amp;/g, "&").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&quot;/g, '"').replace(/'/g, "'");
                        flask1796545710W8V02.addLanguage('shell', Prism.languages['shell']);
                        flask1796545710W8V02.onUpdate((code) => {
                                // do something with code here.
                                // this will trigger whenever the code
                                // in the editor changes.
                          // console.log(code)
                        });
                        // flask.updateCode('云诺');
                        // This will also trigger .onUpdate()
                        flask1796545710W8V02.updateCode(code1796545710W8V02);

                        const currentCode1796545710W8V02 = flask1796545710W8V02.getCode();

                            var coderow1796545710W8V02 = parseInt('0');
                          if (coderow1796545710W8V02 === undefined || coderow1796545710W8V02 !== coderow1796545710W8V02 || coderow1796545710W8V02 === 0) {
                                  coderow1796545710W8V02 = flask1796545710W8V02.lineNumber;
                          }

                            if (coderow1796545710W8V02 < 10) {
                              editorElem1796545710W8V02.parentElement.style.height = '100px';
                                editorElem1796545710W8V02.style.height = '100px';
                            } else if (coderow1796545710W8V02 >= 10 && coderow1796545710W8V02 < 20) {
                              editorElem1796545710W8V02.parentElement.style.height = '300px';
                                editorElem1796545710W8V02.style.height = '300px';
                            } else if (coderow1796545710W8V02 >= 20) {
                              editorElem1796545710W8V02.parentElement.style.height = '500px';
                              editorElem1796545710W8V02.style.height = '500px';
                            }

                        //console.log({currentCode1796545710W8V02})

                        const copyBtn1796545710W8V02 = document.getElementById('codeflask-copy-FEtIN6dak8');
                        copyBtn1796545710W8V02.addEventListener('click', function() {
                          try {
                                // 先检查 Clipboard API 是否可用
                                if (navigator.clipboard && navigator.clipboard.writeText) {
                                    // 使用 Clipboard API 复制代码
                                    navigator.clipboard.writeText(code1796545710W8V02).then(function() {
                                      // 复制成功提示
                                      const originalText = copyBtn1796545710W8V02.innerHTML;
                                      copyBtn1796545710W8V02.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      // 一段时间后恢复原文本
                                      setTimeout(function() {
                                            copyBtn1796545710W8V02.innerHTML = originalText;
                                      }, 2000);
                                    }).catch(function(err) {
                                      // 复制失败处理
                                      console.error('复制失败:', err);

                                      // 降级方案:使用传统的复制方法
                                      fallbackCopyTextToClipboard(code1796545710W8V02);
                                    });
                                } else {
                                    // Clipboard API 不可用时直接使用降级方案
                                    fallbackCopyTextToClipboard(code1796545710W8V02);
                                }

                                // 提取降级方案为独立函数
                                function fallbackCopyTextToClipboard(text) {
                                    const textArea = document.createElement('textarea');
                                    textArea.value = text;
                                    textArea.style.position = 'fixed';
                                    textArea.style.opacity = '0';
                                    document.body.appendChild(textArea);
                                    textArea.select();

                                    try {
                                      document.execCommand('copy');
                                      const originalText = copyBtn1796545710W8V02.innerHTML;
                                      copyBtn1796545710W8V02.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg> 已复制';

                                      setTimeout(function() {
                                            copyBtn1796545710W8V02.innerHTML = originalText;
                                      }, 2000);
                                    } catch (copyErr) {
                                      console.error('传统复制方法也失败了:', copyErr);
                                    } finally {
                                      document.body.removeChild(textArea);
                                    }
                                }
                          } catch (err) {
                                console.error('复制功能不可用:', err);
                          }
                        });

                        const bottomBtn1796545710W8V02 = document.getElementById('codeflask-bottomBtn-FEtIN6dak8');
                        const Toggle1796545710W8V02 = document.getElementById('codeflask-Toggle-FEtIN6dak8');
                        bottomBtn1796545710W8V02.addEventListener('click', function() {
                                if (isCollapsed1796545710W8V02) {
                                    // 展开代码
                                    isCollapsed1796545710W8V02 = false;
                                  const codeElement1796545710W8V02 = editorElem1796545710W8V02.querySelector('.codeflask__code');
                                    if (codeElement1796545710W8V02) {
                                            const actualHeight1796545710W8V02 = codeElement1796545710W8V02.scrollHeight + 20;

                                            editorElem1796545710W8V02.parentElement.style.height = actualHeight1796545710W8V02 + 'px';
                                            editorElem1796545710W8V02.style.height = actualHeight1796545710W8V02 + 'px';
                                    }
                                    bottomBtn1796545710W8V02.innerHTML = '<button class="editorjs-codeFlask_BottomToggle" title="折叠代码"><span class="toggle-icon">▲</span> 折叠</button>';
                                    Toggle1796545710W8V02.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="9 18 15 12 9 6"></polyline></svg>';
                                } else {
                                    // 折叠代码
                                    isCollapsed1796545710W8V02 = true;
                                  if (coderow1796545710W8V02 < 20) {
                                      editorElem1796545710W8V02.parentElement.style.height = '300px';
                                        editorElem1796545710W8V02.style.height = '300px';
                                    } else if (coderow1796545710W8V02 >= 20) {
                                      editorElem1796545710W8V02.parentElement.style.height = '500px';
                                      editorElem1796545710W8V02.style.height = '500px';
                                    }
                                    bottomBtn1796545710W8V02.innerHTML = '<button class="editorjs-codeFlask_BottomToggle expand-mode" title="展开代码" data-empty="false"><span class="toggle-icon">▼</span> 展开</button>';
                                    Toggle1796545710W8V02.innerHTML = '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 9 12 15 18 9"></polyline></svg>';
                                }
                        });

                        Toggle1796545710W8V02.addEventListener('click', function() {
                                bottomBtn1796545710W8V02.click();
                        });
</script><style type="text/css">
.ce-block {
    margin-bottom: 20px;
}

.ce-block__content, .ce-toolbar__content {
    margin-left: auto;
    margin-right: auto;
}

.cdx-quote {
    position: relative;
    background-color: #f8f8f8;
    padding: 24px!important;
    margin: 0px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.quote-background-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0.2;
    z-index: 1;
}

.cdx-quote__text {
    min-height: 30px;
    margin-bottom: 10px;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

.cdx-quote__caption {
    padding: 10px 20px 0px 20px;
    font-size: 14px;
    color: #777;
}

.cdx-quote__caption-left {
    text-align: left;
}

.cdx-quote__caption-center {
    text-align: center;
}

.cdx-quote__caption-right {
    text-align: right;
}

.cdx-quote ::before {
    position: absolute;
    content: attr(data-placeholder);
    color: #bbb;
    font-weight: normal;
    opacity: 0;
}

.cdx-quote :empty::before {
    opacity: 1;
}

.cdx-quote :empty:focus::before {
    opacity: 0;
}

.cdx-quote-settings {
    display: flex;
}

.cdx-quote-settings .cdx-settings-button {
    width: 50%;
}
</style><style type="text/css">
.ce-block {
    margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
        /* max-width:calc(100% - 50px) */
        margin-left: auto;
    margin-right: auto;
}
.ce-paragraph {
    line-height: 1.6em;
    outline: none;
    text-indent: 2em;
    font-size: 16px;
}
.ce-paragraph--right {
    text-align: right;
}
.ce-paragraph--center {
    text-align: center;
}
.ce-paragraph--left {
    text-align: left;
}

.ce-paragraph--justify {
    text-align: justify;
}

.ce-paragraph-text-indent {
    text-align: justify;
}
.ce-paragraph:empty::before{
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
opacity: 0;
}

/** Show placeholder at the first paragraph if Editor is empty */
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty::before {
opacity: 1;
}

.codex-editor--toolbox-opened .ce-block:first-child .ce-paragraph:empty::before,
.codex-editor--empty .ce-block:first-child .ce-paragraph:empty:focus::before {
opacity: 0;
}

.ce-paragraph p:first-of-type{
    margin-top: 0;
}

.ce-paragraph p:last-of-type{
    margin-bottom: 0;
}


.svg-icon {
    width: 1em;
    height: 1em;
}

.svg-icon path,
.svg-icon polygon,
.svg-icon rect {
    fill: #4691f6;
}

.svg-icon circle {
    stroke: #4691f6;
    stroke-width: 1;
}
</style><style type="text/css">
.ce-block {
        margin-top: 20px;
    margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
        /* max-width:calc(100% - 50px) */
        margin-left: auto;
    margin-right: auto;
}
/**
* Plugin styles
*/
.ce-header {
position: relative;
padding: 1px 0px 1px 15px;
margin: 0;
line-height: 1.25em;
outline: none;
margin-bottom: 10px;
}

.ce-header p,
.ce-header div {
padding: 0 !important;
margin: 0 !important;
}
.ce-header::before {
        content: "";
        background-color: #3e8fe3;
        width: 6px;
        height: 100%;
        position: absolute;
        left: 0;
        -webkit-border-radius: 3px;
        -moz-border-radius: 3px;
        border-radius: 3px;
}
/**
* Styles for Plugin icon in Toolbar
*/
.ce-header__icon {
}

.ce-header::before {
position: absolute;
content: attr(data-placeholder);
color: #707684;
font-weight: normal;
display: none;
cursor: text;
}

.ce-header:empty::before {
display: block;
}

.ce-header:empty:focus::before {
display: none;
}
/* FontSize */
h1.ce-header {
    font-size: 2.0em;
}
h2.ce-header {
    font-size: 1.7em;
}
h3.ce-header {
    font-size: 1.4em;
}
h4.ce-header {
    font-size: 1.15em;
}
h5.ce-header {
    font-size: 0.95em;
}
h6.ce-header {
    font-size: 0.8em;
}
/* Alignment*/
.ce-header--right {
text-align: right;
}
.ce-header--center {
text-align: center;
}
.ce-header--left {
text-align: left;
}
.ce-header--justify {
text-align: justify;
}
</style><style type="text/css">
.ce-block {
    margin-bottom: 20px;
}
.ce-block__content,.ce-toolbar__content {
        /* max-width:calc(100% - 50px) */
        margin-left: auto;
        margin-right: auto;
        position: relative;
}

/* 主容器 */
.editorjs-codeFlask_Wrapper {
    border: 1px solid #dcdfe6;
    border-radius: 5px;
    background-color: #f6f8fa;
    margin-bottom: 10px;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
    min-height: 100px;
    overflow: hidden;
}

/* 标题栏 */
.editorjs-codeFlask_Header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 12px;
    background-color: #e9ecef;
    border-bottom: 1px solid #dcdfe6;
    position: relative;
    z-index: 0; /* 从10降低到2 */
}

/* 语言显示 */
.editorjs-codeFlask_LangDisplay {
    padding: 2px 8px;
    background-color: #409eff;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
}

/* 内容容器 - 禁止纵向滚动 */
.editorjs-codeFlask_ContentContainer {
    position: relative;
    min-height: 100px;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: hidden;
    transition: height 0.3s ease;
}

/* 编辑器容器 - 禁止纵向滚动 */
.editorjs-codeFlask_Editor {
    position: relative;
    min-height: 100px;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: hidden;
    transition: height 0.3s ease;
}

/* 底部按钮容器 - 优化为更简洁的样式 */
.editorjs-codeFlask_BottomButtonContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 4px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    position: relative;
    z-index: 0;
}

/* 底部横向折叠/展开按钮 - 优化样式,使其更融入设计 */
.editorjs-codeFlask_BottomToggle {
    width: 100%;
    background-color: transparent;
    color: #606266;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
    position: relative;
}

.editorjs-codeFlask_BottomToggle:hover {
    background-color: #e9ecef;
    color: #409eff;
}

.editorjs-codeFlask_BottomToggle:active {
    background-color: #dee2e6;
}

.editorjs-codeFlask_BottomToggle .toggle-icon {
    font-size: 11px;
    transition: transform 0.3s ease;
}

/* 展开按钮(显示"展开"文本)上边缘添加渐变虚化效果 */
.editorjs-codeFlask_BottomToggle:has(span.toggle-icon:contains("▲"))::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0) 0%, rgba(248, 249, 250, 1) 100%);
    pointer-events: none;
}

/* 展开按钮(显示"展开"文本)上边缘添加渐变虚化效果 */
/* 删除不被广泛支持的:contains()选择器 */
.editorjs-codeFlask_BottomToggle.expand-mode::before {
    content: '';
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(to bottom, rgb(255 255 255 / 0%) 0%, rgba(248, 249, 250, 1) 100%);
    pointer-events: none;
}

/* CodeFlask 主容器样式 */
.editorjs-codeFlask_Editor .codeflask {
    position: relative;
    background: #fafafa;
    border-radius: 0 0 4px 4px;
    min-height: 100px;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: hidden;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 行号容器 */
.editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background-color: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    z-index: 0;
}

/* 行号 */
.editorjs-codeFlask_Editor .codeflask__lines {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    padding: 10px 0;
    background-color: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    z-index: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 21px;
    color: #666;
    text-align: right;
    user-select: none;
    overflow: hidden;
}

.editorjs-codeFlask_Editor .codeflask__lines__line {
    padding-right: 8px;
}

/* 文本区域 - 输入框 */
.editorjs-codeFlask_Editor .codeflask__textarea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    color: transparent;
    caret-color: #333;
    resize: none;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 21px;
    z-index: 1;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: hidden;
    white-space: pre-wrap; /* 自动换行 */
    tab-size: 4;
    outline: none;
}

/* 添加选中文本样式 */
.editorjs-codeFlask_Editor .codeflask__textarea::selection {
    background-color: #b3d4fc;
    color: #333;
}

.editorjs-codeFlask_Editor .codeflask__textarea::-moz-selection {
    background-color: #b3d4fc;
    color: #333;
}

/* 代码预览区域 */
.editorjs-codeFlask_Editor .codeflask__pre {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* 确保宽度不超出容器 */
    height: 100%;
    padding: 10px;
    margin: 0;
    border: none;
    background: transparent;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 21px;
    z-index: 0;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: hidden;
    white-space: pre-wrap; /* 自动换行 */
    pointer-events: none;
}

/* 代码高亮区域 */
.editorjs-codeFlask_Editor .codeflask__code {
    display: block;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 21px;
    color: #333;
    white-space: pre-wrap; /* 自动换行 */
    tab-size: 4;
    overflow: visible;
}

/* 语法高亮样式 - 确保Prism.js样式正确应用 */
.editorjs-codeFlask_Editor .codeflask__code {
    background: transparent !important;
}

/* 通用语法高亮token样式 */
.editorjs-codeFlask_Editor .token.comment,
.editorjs-codeFlask_Editor .token.prolog,
.editorjs-codeFlask_Editor .token.doctype,
.editorjs-codeFlask_Editor .token.cdata {
    color: #708090;
}

.editorjs-codeFlask_Editor .token.punctuation {
    color: #999;
}

.editorjs-codeFlask_Editor .token.namespace {
    opacity: 0.7;
}

.editorjs-codeFlask_Editor .token.property,
.editorjs-codeFlask_Editor .token.tag,
.editorjs-codeFlask_Editor .token.boolean,
.editorjs-codeFlask_Editor .token.number,
.editorjs-codeFlask_Editor .token.constant,
.editorjs-codeFlask_Editor .token.symbol,
.editorjs-codeFlask_Editor .token.deleted {
    color: #905;
}

.editorjs-codeFlask_Editor .token.selector,
.editorjs-codeFlask_Editor .token.attr-name,
.editorjs-codeFlask_Editor .token.string,
.editorjs-codeFlask_Editor .token.char,
.editorjs-codeFlask_Editor .token.builtin,
.editorjs-codeFlask_Editor .token.inserted {
    color: #690;
}

.editorjs-codeFlask_Editor .token.operator,
.editorjs-codeFlask_Editor .token.entity,
.editorjs-codeFlask_Editor .token.url,
.editorjs-codeFlask_Editor .language-css .token.string,
.editorjs-codeFlask_Editor .style .token.string {
    color: #9a6e3a;
    background: hsla(0, 0%, 100%, 0.5);
}

.editorjs-codeFlask_Editor .token.atrule,
.editorjs-codeFlask_Editor .token.attr-value,
.editorjs-codeFlask_Editor .token.keyword {
    color: #07a;
}

.editorjs-codeFlask_Editor .token.function,
.editorjs-codeFlask_Editor .token.class-name {
    color: #dd4a68;
}

.editorjs-codeFlask_Editor .token.regex,
.editorjs-codeFlask_Editor .token.important,
.editorjs-codeFlask_Editor .token.variable {
    color: #e90;
}

/* 复制按钮样式 */
.editorjs-codeFlask_CopyButton {
    background-color: #409eff;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 6px 12px;
    margin-right: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.editorjs-codeFlask_CopyButton:hover {
    background-color: #66b1ff;
}

.editorjs-codeFlask_CopyButton.copied {
    background-color: #67c23a;
}

/* 折叠/展开按钮样式 */
.editorjs-codeFlask_Toggle {
    background-color: #909399;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 0 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    font-weight: bold;
}

.editorjs-codeFlask_Toggle:hover {
    background-color: #a6a9ad;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .editorjs-codeFlask_Header {
      padding: 6px 8px;
    }
   
    .editorjs-codeFlask_Editor .codeflask__textarea,
    .editorjs-codeFlask_Editor .codeflask__pre,
    .editorjs-codeFlask_Editor .codeflask__code {
      font-size: 13px;
      line-height: 19px;
      padding: 8px;
    }
   
    .editorjs-codeFlask_Editor .codeflask.codeflask--has-line-numbers:before {
      width: 35px;
    }
   
    .editorjs-codeFlask_Editor .codeflask__lines {
      width: 35px;
      font-size: 12px;
    }
}

/* 滚动条样式 - 完全隐藏纵向滚动条 */
.editorjs-codeFlask_Wrapper ::-webkit-scrollbar {
    width: 0;/* 纵向滚动条宽度为0 */
    height: 6px;/* 横向滚动条保持6px宽度 */
}

.editorjs-codeFlask_Wrapper ::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 0;
}

.editorjs-codeFlask_Wrapper ::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 0;
}

/* Firefox 滚动条隐藏 */
.editorjs-codeFlask_Wrapper {
    scrollbar-width: none;/* Firefox 隐藏纵向滚动条 */
}

.editorjs-codeFlask_Wrapper ::-moz-scrollbar {
    width: 0;
    height: 6px;
}

/* 焦点状态 */
.editorjs-codeFlask_Wrapper:focus-within {
    border-color: #409eff;
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

/* 只读模式样式 */
.editorjs-codeFlask_Wrapper.readonly .editorjs-codeFlask_Header {
    background-color: #f5f7fa;
}

.editorjs-codeFlask_Wrapper.readonly .editorjs-codeFlask_Editor .codeflask__textarea {
    cursor: default;
}

/* 确保所有元素正确显示 */
.editorjs-codeFlask_Wrapper * {
    box-sizing: border-box;
}

/* 修复行号对齐 */
.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__textarea,
.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__pre {
    padding-left: 50px;
}

.editorjs-codeFlask_Editor .codeflask--has-line-numbers .codeflask__lines {
    padding-top: 10px;
}



/* 语言显示元素 - 添加点击样式 */
.editorjs-codeFlask_LangDisplay {
    padding: 2px 8px;
    background-color: #409eff;
    color: white;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    transition: all 0.2s ease;
}

.editorjs-codeFlask_LangDisplay:hover {
    background-color: #66b1ff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 语言选择弹窗 */
.editorjs-codeFlask_LanguagePopup {
    background-color: white;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    width: 250px;
    max-height: 300px;
    z-index: 1000;
    overflow: hidden;
}

/* 搜索框 */
.editorjs-codeFlask_LanguageSearch {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #ebeef5;
    font-size: 12px;
    outline: none;
    box-sizing: border-box;
}

/* 语言列表 */
.editorjs-codeFlask_LanguagesList {
    max-height: 250px;
    overflow-y: auto;
}

/* 语言选项 */
.editorjs-codeFlask_LanguageItem {
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.editorjs-codeFlask_LanguageItem:hover {
    background-color: #f5f7fa;
}

.editorjs-codeFlask_LanguageItem.selected {
    background-color: #ecf5ff;
    color: #409eff;
    font-weight: 500;
}

/* 滚动条样式 */
.editorjs-codeFlask_LanguagesList::-webkit-scrollbar {
    width: 6px;
}

.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-track {
    background-color: #f5f7fa;
}

.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-thumb {
    background-color: #c0c4cc;
    border-radius: 3px;
}

.editorjs-codeFlask_LanguagesList::-webkit-scrollbar-thumb:hover {
    background-color: #909399;
}
</style><style type="text/css">
.inline-code {
background: rgba(250, 239, 240, 0.78);
color: #b44437;
padding: 3px 4px;
border-radius: 5px;
margin: 0 1px;
font-family: inherit;
font-size: 0.86em;
font-weight: 500;
letter-spacing: 0.3px;
}
</style>
页: [1]
查看完整版本: Linux服务器的必修课 SSH 改密钥登录 + 修改端口 + 关闭密码登录