-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (20 loc) · 701 Bytes
/
Copy pathDockerfile
File metadata and controls
27 lines (20 loc) · 701 Bytes
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
FROM ubuntu:22.04
RUN apt-get update && apt-get install -y \
openssh-server \
sudo \
curl \
wget \
nano \
vim \
findutils \
rsyslog \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /run/sshd
RUN useradd -m -s /bin/bash corentin && \
echo "corentin:password123" | chpasswd
RUN echo "corentin ALL=(ALL) NOPASSWD: /usr/bin/find" >> /etc/sudoers.d/corentin && \
chmod 0440 /etc/sudoers.d/corentin
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config && \
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
EXPOSE 22
CMD ["/bin/bash", "-c", "rsyslogd && exec /usr/sbin/sshd -D"]