zoukankan      html  css  js  c++  java
  • VS Code 搭建远程调试Shell环境(Remote Linux)

    安装Remote Development插件

    1. 在本机安装Remote Development
    2. 重启VS Code,看到左侧导航新增:『远程资源管理器』
    3. 在『远程资源管理器』连接服务器,略

    安装语法提示插件:shellman

    • 本机安装shellman,略

    安装格式化插件:shell-format(右键 -> 格式化文档(Ctrl + Alt + L))

    1. 在远程服务器上,VS Code安装shell-format
    2. 服务器安装:shfmt(shell-format依赖于安装shfmt)
    3. 网速好会自动安装shfmt,否则手动安装,查看:4
    4. 进入安装shfmt,下载shfmt_v3.0.1_linux_amd64,复制到服务器,并在服务器执行
    # 把shfmt_v3.0.1_linux_amd64移动到/root/.vscode-server/extensions/foxundermoon.shell-format-7.0.1/bin(具体路径可在VS Code查看)
    mv shfmt_v3.0.1_linux_amd64 /root/.vscode-server/extensions/foxundermoon.shell-format-7.0.1/bin
    
    # 添加权限
    chmod a+x /root/.vscode-server/extensions/foxundermoon.shell-format-7.0.1/bin/shfmt_v3.0.1_linux_amd64
    

    安装语法错误检查插件:shellcheck

    • 在远程服务器上,VS Code安装shell-format

    安装语法错误检查插件:Code Runner

    • 在远程服务器上,VS Code安装Code Runner

    配置免密码登录

    1. 在本机上生成ssh秘钥:
    ssh-keygen -t rsa -b 4096 
    
    1. 在服务器上把公钥(路径为:C:Users<UserName>.sshid_rsa.pub)写入.ssh/authorized_keys

    2. 设置权限

    chmod 700 .ssh
    chmod 600 .ssh/authorized_keys
    
    1. 在VS Code编辑配置文件(config):
    Host yourdomain.com
      HostName yourdomain.com
      User root
      IdentityFile C:Users<UserName>.sshid_rsa
    
  • 相关阅读:
    checkedListBox 的用发
    C# 控件命名规范
    控件数据及相应的事件处理
    MDI 窗口的创建
    摄像头中运动物体识别
    1
    静态检测大风车初版
    不会难道我还不能附上链接吗
    计算机操作素材
    数字识别
  • 原文地址:https://www.cnblogs.com/testopsfeng/p/13945846.html
Copyright © 2011-2022 走看看