CentOS或RHEL安装vscode

下载rpm安装包

安装

bash 复制代码
rpm -i code-server-4.19.1-amd64.rpm

关闭和禁用防火墙

  • 如果是云服务器,请开启对应端口的安全组

    bash 复制代码
    systemctl stop firewalld.service
    bash 复制代码
    systemctl disable firewalld.service

启动生成配置文件

  • 此时应该会启动失败

    bash 复制代码
    systemctl enable --now code-server@root
  • 生成的配置文件再隐藏目录中(ls -a):~/.config/code-server/config.yaml

  • 修改配置文件如下:

    yaml 复制代码
    bind-addr: 0.0.0.0:8080 # ip设置为0 ,否则浏览器无法访问
    auth: password
    password: 8fec657532c10550b60a6d5b # 密码自己设置
    cert: false # 是否开启https证书,不开启除了图片无法预览外,无影响开发使用

启动/停止

bash 复制代码
systemctl start code-server@root
bash 复制代码
systemctl stop code-server@root

查看运行状态

bash 复制代码
systemctl status code-server@root

查看运行日志

bash 复制代码
journalctl -u code-server@root

安装开发环境

  • 如果是java环境,需要先在服务器安装jdk和maven

    bash 复制代码
    yum install java-11-openjdk
  • 安装vscode插件

  • 配置国内源

相关推荐
orion577 小时前
Missing Semester Class1:course overview and introduction of shell
linux
用户1204872216113 小时前
Linux驱动编译与加载
linux·嵌入式
用户8055336980319 小时前
Input 子系统架构:Core、Handler、Driver 三层是怎么协作的
linux·嵌入式
用户8055336980319 小时前
RK-Forge外设系列开篇 - 把板子从「能启动」变成「能用」:Ethernet/SPI/MMC 三个纯接线外设
linux·github·嵌入式
七歌杜金房1 天前
我终于又有了自己的 Linux 电脑
linux·debian·mac
tntxia2 天前
linux curl命令详解_curl详解
linux
扛枪的书生2 天前
Linux 网络管理器用法速查
linux
顺风尿一寸3 天前
Java Socket 内核之旅:从 SocketChannel.read() 到 tcp_recvmsg 与 epoll 的完整调用链路
linux
XIAOHEZIcode3 天前
Ubuntu 终端美化全栈指南:Bash 到 Kitty 踩坑实录
linux·ubuntu·命令行
唐青枫3 天前
别再只会用 cron:Linux systemd Timer 定时任务实战详解
linux