# 靶机程序安装手册 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. 串口授权 默认安装环境已完成 更新apt ```shell sudo apt update ``` ### 2.1 安装openssh-server(镜像可能自带) ```shell sudo apt-get install openssh-server ``` ### 2.2 安装net-tools(镜像可能自带) ```shell sudo apt-get install net-tools ``` ### 2.3 安装git ```shell sudo apt-get install git ``` ### 2.4 安装dotnet8 参考链接-微软安装手册 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 sudo apt-get install dotnet-sdk-8.0 ``` ### 2.5 串口授权(如果用户名为其它则修改为u) ```shell sudo usermod -aG dialout u ``` ### 2.6 关闭防火墙&允许访问端口 检查防火墙状态 ```shell sudo ufw status ``` 如果关闭 Status: inactive 如果开启,关闭防火墙 ```shell sudo ufw disable ``` 或者开启对应端口 ```shell sudo ufw allow ``` ## 3. 编译安装软件 1. 克隆项目(项目地址以实际地址为准) 2. 打release包 3. 注册程序为Systemctl 服务 ### 3.1 克隆项目 ```shell git clone http://124.222.119.133:3000/petejk/TargetService ``` ### 3.2 发布release包 ```shell cd TargetService dotnet publish --configuration Release ``` ### 3.3 注册程序为Systemctl 服务 ```shell # 切换到工程对应路径SystemCtl下 cd SystemCtl # 启动install.sh脚本 sudo chmod 777 install.sh ./install.sh ``` ### 3.4 开启或关闭服务 ```shell # 开启服务 sudo systemctl start TrackTarget.service # 关闭服务 sudo systemctl stop TrackTarget.service # 重启服务 sudo systemctl restart TrackTarget.service # 查看运行状态 sudo systemctl status TrackTarget.service ```