-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (24 loc) · 1.18 KB
/
Dockerfile
File metadata and controls
28 lines (24 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM ubuntu:24.04
# Set environment variables to avoid interactive prompts during installation
ENV DEBIAN_FRONTEND=noninteractive
# Install OpenSSH server, clean up, create directories, set permissions, and configure SSH
RUN apt update \
&& (echo "y") | unminimize \
&& apt install -y ubuntu-desktop \
&& apt install -y sudo iproute2 iputils-ping openssh-server telnet curl \
&& apt clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& (echo "password"; echo "password") | passwd ubuntu \
&& mkdir -p /home/ubuntu/.ssh \
&& chown -R ubuntu /home/ubuntu \
&& mkdir /run/sshd \
&& echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config \
&& echo "PermitRootLogin no" >> /etc/ssh/sshd_config \
&& sudo mkdir -p /etc/apt/keyrings && curl -fsSL https://packages.openvpn.net/packages-repo.gpg | sudo tee /etc/apt/keyrings/openvpn.asc \
&& echo "deb [signed-by=/etc/apt/keyrings/openvpn.asc] https://packages.openvpn.net/openvpn3/debian noble main" | sudo tee /etc/apt/sources.list.d/openvpn-packages.list \
&& sudo apt update \
&& sudo apt -y install openvpn3
# Expose SSH port
EXPOSE 22
# Start SSH server
CMD /usr/sbin/sshd -D