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插件

  • 配置国内源

相关推荐
bukeyiwanshui4 小时前
20260417 DNS实验
linux
代码中介商4 小时前
Linux 帮助手册与用户管理完全指南
linux·运维·服务器
weixin_449173656 小时前
Linux -- 项目中查找日志的常用Linux命令
linux·运维·服务器
dyxal6 小时前
VS Code 终端疑难杂症排查:为什么 PowerShell 无法启动?
vscode
【ql君】qlexcel6 小时前
Visual Studio Code开发STM32设置头文件宏定义uint32_t报错
vscode·stm32·vs code·头文件宏定义·uint32_t报错·uint8_t报错·uint16_t报错
琉璃榴6 小时前
Visual Studio Code连接远程服务器
服务器·vscode·github
想唱rap7 小时前
C++智能指针
linux·jvm·数据结构·c++·mysql·ubuntu·bash
Strugglingler7 小时前
基于whiptail开发shell导航工具
linux·shell·ui设计·whiptail
艾醒(AiXing-w)7 小时前
Linux系统管理(二十)——Linux root磁盘不足?一站式应急清理方案(亲测可用)
linux·运维·服务器
小义_8 小时前
【Kubernetes】(五) pod2
linux·云原生·容器·kubernetes