Initial commit
This commit is contained in:
26
debian/Dockerfile
vendored
Normal file
26
debian/Dockerfile
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM debian:13
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install -y \
|
||||
openssh-server \
|
||||
sudo \
|
||||
python3 \
|
||||
ca-certificates && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN useradd -m -s /bin/bash nicolo && \
|
||||
echo "nicolo ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/nicolo
|
||||
|
||||
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config && \
|
||||
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin no/' /etc/ssh/sshd_config
|
||||
|
||||
RUN mkdir /home/nicolo/.ssh && \
|
||||
chmod 700 /home/nicolo/.ssh
|
||||
|
||||
COPY id_ansible_lab.pub /home/nicolo/.ssh/authorized_keys
|
||||
|
||||
RUN chown nicolo:nicolo -R /home/nicolo/.ssh && chmod 600 /home/nicolo/.ssh/authorized_keys
|
||||
|
||||
EXPOSE 22
|
||||
CMD ["/usr/sbin/sshd", "-D"]
|
||||
|
||||
Reference in New Issue
Block a user