Create Dockerfile
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:latest
|
2 |
+
|
3 |
+
RUN apt-get update && apt-get install -y \
|
4 |
+
openssh-server \
|
5 |
+
python3 \
|
6 |
+
python3-pip && \
|
7 |
+
mkdir /var/run/sshd
|
8 |
+
|
9 |
+
RUN echo 'root:rootpassword' | chpasswd
|
10 |
+
|
11 |
+
# Разрешаем root-доступ по SSH
|
12 |
+
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
|
13 |
+
|
14 |
+
# Разрешаем использование пароля
|
15 |
+
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
|
16 |
+
|
17 |
+
EXPOSE 22
|
18 |
+
|
19 |
+
CMD ["/usr/sbin/sshd", "-D"]
|