Debian 配置 CoPiD 网络

一 名称纠正与准备
sudo find / -name copidar.conf 2>/dev/null 或 sudo find / -name config.yaml 2>/dev/null。同时确认服务名可能是 copid 或 copidar,可用 systemctl list-units --type=service | grep -i copid 查看。二 安装与配置文件定位
sudo apt update && sudo apt install copidar(或 copid)。安装后优先检查 /etc/copid.conf 或 /etc/copidar/ 目录。sudo apt update && sudo apt install python3-pip,然后 pip3 install copidar。此类安装常见配置为 ~/.config/copidar/config.yaml 或 /etc/copidar/config.yaml。三 配置网络参数
[port]8080[host]0.0.0.0[password]your_strong_password说明:监听端口设为 8080,绑定地址 0.0.0.0(允许任意来源),并设置强密码。{"port": 8080,"listen_ip": "0.0.0.0","max_connections": 100,"timeout": 30,"ssl": false}说明:可同时调整最大连接数、超时与是否启用 SSL。server:host: 0.0.0.0port: 8080authentication:enabled: trueapi_key: your_api_key_herelogging:level: infofile: /var/log/copidar.log说明:支持开启鉴权(如 api_key)与日志文件输出,便于排障与审计。四 启动与防火墙
sudo systemctl start copid && sudo systemctl enable copidsudo systemctl start copidar && sudo systemctl enable copidarsudo systemctl status copid(或 copidar)sudo ufw allow 8080/tcpsudo ufw status五 客户端连接与验证
copid-client your_server_ip 8080 your_passwordnc -vz your_server_ip 8080 或 curl -v http://your_server_ip:8080sudo tail -f /var/log/copidar.logscp /path/to/local/file user@your_server_ip:/path/to/remote/directory