Ajout run

This commit is contained in:
Serge NOEL
2026-02-13 15:48:30 +01:00
parent d78e04366f
commit b474c26ef2
2 changed files with 9 additions and 3 deletions

View File

@@ -17,11 +17,17 @@ RUN apt-get update && apt-get install -y openssh-server && rm -rf /var/lib/apt/l
# Set up SSH
# RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# Create user 'platformio' with password 'platformio' and add to sudo
RUN useradd -m -s /bin/bash platformio \
&& echo 'platformio:platformio' | chpasswd \
&& adduser platformio sudo
# Allow password authentication for SSH and allow user 'platformio' to login
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
EXPOSE 22
# Set working directory
WORKDIR /workspace
# SER platformio
CMD ["/usr/sbin/sshd", "-D"]