I'm trying to ssh into a container for Azure app service. I have followed the instructions for configuring my container here:
https://learn.microsoft.com/en-gb/azure/app-service/containers/configure-custom-container#enable-ssh
and the instructions to connect here:
https://learn.microsoft.com/en-gb/azure/app-service/containers/app-service-linux-ssh-support
Here are the relevant steps in my docker file:
RUN apt-get update \
&& apt-get install -y --no-install-recommends dialog \
&& apt-get update \
&& apt-get install -y --no-install-recommends openssh-server \
&& echo "root:Docker!" | chpasswd
EXPOSE 8000 2222
COPY sshd_config /etc/ssh/
CMD ./bin/start.sh
where start.sh starts runs service ssh start. The sshd_config file is
# This is ssh server systemwide configuration file.
#
# /etc/sshd_config
Port 2222
ListenAddress 0.0.0.0
LoginGraceTime 180
X11Forwarding yes
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
MACs hmac-sha1,hmac-sha1-96
StrictModes yes
SyslogFacility DAEMON
PasswordAuthentication yes
PermitEmptyPasswords no
PermitRootLogin yes
Subsystem sftp internal-sftp
When I try and connect by ssh from the portal it first says "CONNECTED | CREDENTIALS"
then after 30 seconds or so it says "SSH CONNECTION CLOSE - Error: connect ECONNREFUSED <ip>:2222"
Not sure why this is not connecting?