mirror of
https://github.com/shadow1ng/fscan.git
synced 2025-07-13 12:52:44 +08:00
feat: 添加SSH测试靶场
This commit is contained in:
parent
672dfee2ac
commit
bf1b45f407
20
TestDocker/SSH/Dockerfile
Normal file
20
TestDocker/SSH/Dockerfile
Normal file
@ -0,0 +1,20 @@
|
||||
# 使用Ubuntu最新版本作为基础镜像
|
||||
FROM ubuntu:latest
|
||||
|
||||
# 安装必要的软件包
|
||||
RUN apt-get update && apt-get install -y \
|
||||
openssh-server \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 创建SSH所需的目录
|
||||
RUN mkdir /var/run/sshd
|
||||
|
||||
# 允许root用户SSH登录并设置密码
|
||||
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
||||
RUN echo 'root:123456' | chpasswd
|
||||
|
||||
# 开放22端口
|
||||
EXPOSE 22
|
||||
|
||||
# 启动SSH服务
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
2
TestDocker/SSH/README.txt
Normal file
2
TestDocker/SSH/README.txt
Normal file
@ -0,0 +1,2 @@
|
||||
docker build -t ubuntu-ssh .
|
||||
docker run -d -p 22:22 ubuntu-ssh
|
Loading…
Reference in New Issue
Block a user