靶机服务端(适用于Linux系统控制靶机的情况)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

154 lines
2.7 KiB

4 weeks ago
# 靶机程序安装手册
Version`V0.1`试行版
修订记录
| 日期 | 版本 | 说明 | 作者 |
| ------------- | ---- | -------- | ------ |
| 2025年12月4日 | V0.1 | 首次编写 | 朱冠臣 |
| | | | |
| | | | |
| | | | |
## 1. 概述
> 本文档为安装手册,用于任何形式的轨道靶机,不限于地轨,空轨,竖轨等等。
>
> 靶机运行环境为如下
>
> - 架构为AMD64
> - 需要预装.net8 运行时
> - 设备具备ch341或ch340驱动
>
> 靶机需提前配置好串口编号并测试串口信息输出
## 2. 安装系统环境
1. Ubuntu20.04
2. openssh-server
3. net-tools
4. git
5. dotnet8
6. 串口授权
默认安装环境已完成
4 weeks ago
更新apt
```shell
sudo apt update
```
### 2.1 安装git
4 weeks ago
```shell
3 weeks ago
sudo apt-get install git -y
4 weeks ago
```
### 2.2 安装dotnet8
4 weeks ago
参考链接-微软安装手册 https://learn.microsoft.com/zh-cn/dotnet/core/install/linux-ubuntu-decision#register-the-microsoft-package-repository
```shell
# Get OS version info which adds the $ID and $VERSION_ID variables
source /etc/os-release
# Download Microsoft signing key and repository
wget https://packages.microsoft.com/config/$ID/$VERSION_ID/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
# Install Microsoft signing key and repository
sudo dpkg -i packages-microsoft-prod.deb
# Clean up
rm packages-microsoft-prod.deb
# Update packages
sudo apt update
```
安装dotnet
```shell
3 weeks ago
sudo apt-get install dotnet-sdk-8.0 -y
4 weeks ago
```
### 2.3 串口授权(如果用户名为其它则修改为u)
4 weeks ago
```shell
sudo usermod -aG dialout u
```
### (可选)2.6 关闭防火墙&允许访问端口
4 weeks ago
检查防火墙状态
```shell
sudo ufw status
```
如果关闭
Status: inactive
如果开启,关闭防火墙
```shell
sudo ufw disable
```
或者开启对应端口
```shell
sudo ufw allow <port/service>
```
## 3. 编译安装软件
1. 克隆项目(项目地址以实际地址为准)
2. 打release包
3. 注册程序为Systemctl 服务
### 3.1 克隆项目
```shell
4 weeks ago
git clone http://124.222.119.133:3000/petejk/TargetService
4 weeks ago
```
### 3.2 发布release包
```shell
4 weeks ago
cd TargetService
4 weeks ago
dotnet publish --configuration Release
```
### 3.3 注册程序为Systemctl 服务
```shell
# 切换到工程对应路径SystemCtl下
cd SystemCtl
# 启动install.sh脚本
sudo chmod 777 install.sh
./install.sh
```
### 3.4 开启或关闭服务
```shell
# 开启服务
4 weeks ago
sudo systemctl start Target.service
4 weeks ago
# 关闭服务
4 weeks ago
sudo systemctl stop Target.service
4 weeks ago
# 重启服务
4 weeks ago
sudo systemctl restart Target.service
4 weeks ago
# 查看运行状态
4 weeks ago
sudo systemctl status Target.service
4 weeks ago
```