Initial commit (with nginx...)
This commit is contained in:
29
docker/almalinux/Dockerfile
Normal file
29
docker/almalinux/Dockerfile
Normal file
@@ -0,0 +1,29 @@
|
||||
FROM almalinux:9
|
||||
|
||||
RUN dnf update -y && \
|
||||
dnf install -y \
|
||||
openssh-server \
|
||||
sudo \
|
||||
python3
|
||||
#rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN mkdir /var/run/sshd
|
||||
|
||||
RUN ssh-keygen -A
|
||||
|
||||
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