Hi @Tobias_Trabelsi,
I am using this in my init_container.sh file
#!/bin/bash
echo “Starting SSH Service”
rc-service sshd start
Below is the SSH part in my Dockerfile
install SSH Server
COPY init_container.sh /opt/startup/init_container.sh
COPY sshd_config /etc/ssh/
RUN apk add --update openssh-server \
&& echo “root:Docker!” | chpasswd \
&& apk update && apk add openrc \
&& sed -i ‘s/\tcgroup_add_service/\t#cgroup_add_service/g’ /lib/rc/sh/openrc-run.sh \
&& chmod 755 /opt/startup/init_container.sh \
&& apk add --no-cache bash;
I have also followed the Microsoft documentation to enable SSH as per below:
I am using port 2222 in my sshd_config file. Azure webapp container SSH (WebSSH) listens on port 2222.
I am still wondering that do I still need to create ssh keys to make it SSH work. is this requirement to have ssh-keygen in the dockerfile.
Thank you for your support