Linux 系统版本:Ubuntu 18.04(众多师傅的反馈发现 Ubuntu 20 会出现不可预测的 bug,我之前也是用 Ubuntu 20.04)
2 Ubuntu 靶机安装
VM 安装过程略。
登录后修改下 root 密码:
1
sudo passwd root
进行 SSH 安装,目前靶机用不到 VMware Tools:
1
apt install -y ssh
因为要后续要进行多个软件安装,更新下 apt 源:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
apt install -y vim vim /etc/apt/sources.list ## aliyun deb https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse deb-src https://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
root@docker:/opt/CTFd# docker-compose up -d ...... ERROR: This node is not a swarm manager. Use "docker swarm init" or "docker swarm join" to connect this node to swarm and try again.
<divclass="container-fluid bg-warning text-center py-3"> <divclass="row"> <divclass="col-md-12"> <aclass="btn btn-warning"href="{{ get_config('version_latest') }}"> A new CTFd version is available! </a> </div> </div> </div>
世界清净了:
8.6 容器题目
建议创建题目时不要直接填镜像 ID,先拉取不然创建很慢。
8.7 开启自启动
创建一个 ctfd.sh 放在根目录,内容如下:
1 2
#!/bin/bash docker-compose -f /opt/CTFd/docker-compose.yml up -d
root@docker:~# systemctl start ctfd.service root@docker:~# systemctl status ctfd.service ● ctfd.service - CTFd Start Loaded: loaded (/etc/systemd/system/ctfd.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2023-11-09 23:57:35 CST; 212ms ago Main PID: 9098 (ctfd.sh) Tasks: 2 (limit: 2281) CGroup: /system.slice/ctfd.service ├─9098 /bin/bash /root/ctfd.sh └─9099 /usr/bin/python3 /usr/local/bin/docker-compose -f /opt/CTFd/docker-compose.yml up -d
11月 09 23:57:35 docker systemd[1]: Started CTFd Start. 11月 09 23:57:35 docker ctfd.sh[9098]: /usr/local/lib/python3.6/dist-packages/paramiko/transport.py:32: CryptographyDeprecationWarning: Python 3.6 is no longer supported by the Python core team. Therefore 11月 09 23:57:35 docker ctfd.sh[9098]: from cryptography.hazmat.backends import default_backend 11月 09 23:57:35 docker ctfd.sh[9098]: The Docker Engine you're using is running in swarm mode. 11月 09 23:57:35 docker ctfd.sh[9098]: Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node. 11月 09 23:57:35 docker ctfd.sh[9098]: To deploy your application across the swarm, use `docker stack deploy`.