下载code-server安装包
https://github.com/coder/code-server/releases
下载地址:https://github.com/coder/code-server/releases/download/v4.20.0/code-server_4.20.0_amd64.deb
sudo dpkg -i code-server_4.4.0_amd64.deb
# 安装
root@Debian10:/home/download# sudo dpkg -i code-server_4.20.0_amd64.deb
Selecting previously unselected package code-server.
(Reading database ... 67825 files and directories currently installed.)
Preparing to unpack code-server_4.20.0_amd64.deb ...
Unpacking code-server (4.20.0) ...
Setting up code-server (4.20.0) ...
# 运行一次生成配置文件
root@Debian10:/home/download# code-server
[2024-01-18T06:53:04.033Z] info Wrote default config file to /root/.config/code-server/config.yaml
[2024-01-18T06:53:04.761Z] info code-server 4.20.0 d0215eca8804d0be5d3551c39404e336032c3141
[2024-01-18T06:53:04.762Z] info Using user-data-dir /root/.local/share/code-server
[2024-01-18T06:53:04.786Z] info Using config file /root/.config/code-server/config.yaml
[2024-01-18T06:53:04.787Z] info HTTP server listening on http://127.0.0.1:8080/
[2024-01-18T06:53:04.787Z] info - Authentication is enabled
[2024-01-18T06:53:04.787Z] info - Using password from /root/.config/code-server/config.yaml
[2024-01-18T06:53:04.787Z] info - Not serving HTTPS
[2024-01-18T06:53:04.787Z] info Session server listening on /root/.local/share/code-server/code-server-ipc.sock
# 编辑配置文件,并打印
root@Debian10:/home/download# vim ~/.config/code-server/config.yaml
root@Debian10:/home/download# cat ~/.config/code-server/config.yaml
bind-addr: 0.0.0.0:80
auth: password
password: jihuo
cert: false
# 运行
root@Debian10:/home/download# code-server
[2024-01-18T06:54:27.555Z] info code-server 4.20.0 d0215eca8804d0be5d3551c39404e336032c3141
[2024-01-18T06:54:27.556Z] info Using user-data-dir /root/.local/share/code-server
[2024-01-18T06:54:27.577Z] info Using config file /root/.config/code-server/config.yaml
[2024-01-18T06:54:27.578Z] info HTTP server listening on http://0.0.0.0/
[2024-01-18T06:54:27.578Z] info - Authentication is enabled
[2024-01-18T06:54:27.578Z] info - Using password from /root/.config/code-server/config.yaml
[2024-01-18T06:54:27.578Z] info - Not serving HTTPS
[2024-01-18T06:54:27.578Z] info Session server listening on /root/.local/share/code-server/code-server-ipc.sock
[14:54:50]
[14:54:50] Extension host agent started.
[14:54:50] Started initializing default profile extensions in extensions installation folder. file:///root/.local/share/code-server/extensions
[14:54:50] Completed initializing default profile extensions in extensions installation folder. file:///root/.local/share/code-server/extensions
File not found: /usr/lib/code-server/lib/vscode/out/vsda_bg.wasm
[14:54:57] [10.37.129.2][2b38f4c8][ManagementConnection] New connection established.
File not found: /usr/lib/code-server/lib/vscode/out/vsda.js
[2024-01-18T06:54:59.064Z] error Failed to get latest version {"error":"connect ENETUNREACH 20.205.243.168:443 - Local (0.0.0.0:0)"}
[14:54:59] [10.37.129.2][2cd9b201][ExtensionHostConnection] New connection established.
[14:54:59] [10.37.129.2][2cd9b201][ExtensionHostConnection] <2192> Launched Extension Host Process.
放入后台运行
#放入后台执行后,键盘输入ctrl + z 暂停任务
键盘按 ctrl + z 暂停
[1]+ Stopped
# 此时输入jobs命令可以查看当前被暂停的任务
jobs
[1]+ Stopped
# bg将其放入后台,输入 bg %1,将进程号为1的进程恢复到后台运行
bg %1
[1]+ xxxx
#查看任务已经在后台运行:
jobs
[1]+ Running xxxx
# 使用disown -h 将这个作业忽略HUP信号:
disown -h %1 //忽略这个作业的HUP信号
jobs
[1]+ Running xxxxxx
评论